0

I have seen that writing anything after the completion of any
pre-processor compiler directive does not affect either compilation or
running of the program.
i.e.
#include<conio.h> 123as!#@
#define M 100 *&^asdf
is perfectly valid.

How can such athing happen ?

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by Ancient Dragon
0

I'm not shore that I understood your problem.

#if 0
/* you can put here anything and the compiler wouldn't consider it */
#else
/* while this part will be considered */
#endif /* if 0 */
0

>>#define M 100 *&^asdf
the compiler does not evaluate macros until used. If you coded something like below your compiler would complain bitterly at you int x = M;

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.