944,125 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Marked Solved
  • Views: 1082
  • C RSS
Jan 26th, 2007
0

New

Expand Post »
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 ?
Reputation Points: 193
Solved Threads: 25
Posting Pro
Jishnu is offline Offline
518 posts
since Oct 2006
Jan 26th, 2007
0

Re: New

I'm not shore that I understood your problem.
  1. #if 0
  2. /* you can put here anything and the compiler wouldn't consider it */
  3. #else
  4. /* while this part will be considered */
  5. #endif /* if 0 */
Reputation Points: 251
Solved Threads: 29
Posting Whiz in Training
andor is offline Offline
274 posts
since Jun 2005
Jan 26th, 2007
0

Re: New

>>#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;
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2283
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,961 posts
since Aug 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: function problem in C
Next Thread in C Forum Timeline: Help with file read/write plz





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC