Hi there,
Quote:
Originally Posted by keithostertag
New to programming. In several texts and online resources I have read that whitespace is irrelevant in C (except of course with strings).
|
that's true, AFAIS.
Quote:
Originally Posted by keithostertag
Code:
#include < stdio.h>
A space before or after the header filename produces a fatal compile error. I have never seen this mentioned (yet).
|
This is -strictly speaking- not a C issue. The directives starting with a hash sign are parsed by the preprocessor, which used to be a separate tool in earlier compiler designs. Today, it's usually integrated in the compiler. Yet the preprocessing is a pass of its own, formally.
Anyway ... In your example, the < and > characters are considered string delimiters, and so the contents they enclose is a string. Note that you may use quotes instead of the < > and then you wouldn't have seen this as an exeption, would you?
However, there is a difference between using quotes and angle brackets with #include. If you use angle brackets, the compiler searches for the included file in its pre-configured include directories. If you use quotes, it searches in the source file's directory first, and then in the include directories.
[X] Doc CPU