Click here to Skip to main content
15,867,923 members
Articles / Programming Languages / Javascript
Alternative
Tip/Trick

Super-Easy Code Block Toggling

Rate me:
Please Sign up or sign in to vote.
4.75/5 (4 votes)
15 Nov 2011CPOL 11.2K   5
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:


C++
#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
 *:)
 */

:)

License

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


Written By
Student
Turkey Turkey
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

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

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

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