Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: Beginner
Aug 28, 2006

Use a Macro to Improve Your Debug Output

Frequently, and especially during development and debugging, you want to write out the values of a variable. To distinguish these variables, label them by putting this directive in:

#define PUTOUT(x) cout<<#x<<" = "<<x<<endl;
Then, inside the code, put:

PUTOUT(Variable);
PUTOUT(Variable_2);    

Jim Huneycutt
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap