Click here to Skip to main content
12,829,458 members (45,002 online)
Click here to Skip to main content
Add your own
alternative version


Posted 21 Aug 2011

Super-Easy Code Block Toggling

, 15 Nov 2011 CPOL
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__)
  #define dprintf(...)


dprintf("In debug mode.");


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



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


About the Author

Caner Korkmaz
Turkey Turkey
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralNo john, the code is filtered out in release mode. Zero ove... Pin
JackDingler14-Nov-11 10:54
memberJackDingler14-Nov-11 10:54 
GeneralInteresting, but it does mean you will have additional code ... Pin
John Kasra20-Sep-11 12:53
memberJohn Kasra20-Sep-11 12:53 
GeneralThanks for your comment :) And yes, it is supported at the v... Pin
Caner Korkmaz23-Aug-11 1:21
memberCaner Korkmaz23-Aug-11 1:21 
GeneralFor info: not supported in MS VC 2003, but supported in MS V... Pin
YvesDaoust23-Aug-11 0:51
memberYvesDaoust23-Aug-11 0:51 
GeneralReason for my vote of 5 Cool syntax, I dind't know of that e... Pin
YvesDaoust23-Aug-11 0:51
memberYvesDaoust23-Aug-11 0: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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170326.1 | Last Updated 15 Nov 2011
Article Copyright 2011 by Caner Korkmaz
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid