Click here to Skip to main content
Click here to Skip to main content
Alternative Tip
Go to top

Super-Easy Code Block Toggling

, 15 Nov 2011
Rate this:
Please Sign up or sign in to vote.
For debug use, you can do something like this:#ifdef DEBUG #define dprintf(...) printf(__VA_ARGS__)#else #define dprintf(...)#endif//Usage:dprintf("In debug mode.");//orchar *foo = "foo";dprintf("%d bar.",foo);// :)/*Edit reason :: *if you type...

For debug use, you can do something like this:

#ifdef DEBUG
  #define dprintf(...) printf(__VA_ARGS__)
#else
  #define dprintf(...)
#endif
 
//Usage:

dprintf("In debug mode.");
 
//or

char *foo = "foo";
dprintf("%d bar.",foo);
 
// :)

 
/*Edit reason ::
 *if you type dprintf("text")
 *it was giving error.
 *Now it doesn't give an error
 *:)
 */

Smile | :)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Caner Korkmaz
Student
Turkey Turkey
No Biography provided

Comments and Discussions

 
GeneralNo john, the code is filtered out in release mode. Zero ove... PinmemberJackDingler14-Nov-11 9:54 
GeneralInteresting, but it does mean you will have additional code ... PinmemberJohn Kasra20-Sep-11 11:53 
GeneralThanks for your comment :) And yes, it is supported at the v... PinmemberCaner Korkmaz23-Aug-11 0:21 
GeneralFor info: not supported in MS VC 2003, but supported in MS V... PinmemberYvesDaoust22-Aug-11 23:51 
GeneralReason for my vote of 5 Cool syntax, I dind't know of that e... PinmemberYvesDaoust22-Aug-11 23:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 15 Nov 2011
Article Copyright 2011 by Caner Korkmaz
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid