Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / Javascript

Super-Easy Code Block Toggling

4.75/5 (4 votes)
15 Nov 2011CPOL 12.8K  
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)