| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Work with all your cloud files (Drive, Dropbox, and Slack and Gmail attachments) and documents (Google Docs, Sheets, and Notion) in one place. Try Dokkio (from the makers of PBworks) for free. Now available on the web, Mac, Windows, and as a Chrome extension!

View
 

PreprocessorComment

Page history last edited by Kenneth Finnegan 13 years, 6 months ago

This code operates by having the preprocessor evaluate the expesion 0, which is always going to evaluate to be false, and the code in the if statement will be ignored.  This is a better way to comment out huge blocks of code than /* */ because it nests and is more obvious that it's a temporary removal of a chunk of code.

 

Code:

#if 0

Useless code;

More useless code;

Even more useless code;

#endif 

 


Extensions:

I would make sure to leave a comment with the #if 0 explaining why it was commented out and what it was replaced it or if it's meant to be fixed and uncommented.

 


Sources:

None.

Comments (0)

You don't have permission to comment on this page.