Using Preprocessing in cpp



#define <identifier> <replacement token list>                   
 // object-like macro
#define <identifier>(<parameter list>) <replacement token list>  
// function-like macro, note parameters
#define RADTODEG(x) ((x) * 57.29578)
#define MAX 200
#define Pi acos(-1.0)
#define LL long long
#define F(i, b) for( int i = 0; i < (b); i++ )
int a[MAX];
F(i,MAX)
  a[i]=0;

Conditional compilation
#if VERBOSE >= 2
  print("trace message");
#endif

User-defined compilation errors and warnings
The #error directive outputs a message through the error stream.

#error "Gaah!"

ref http://en.wikipedia.org/wiki/C_preprocessor

Popular posts from this blog

เทคนิค ชนะ เกมเศรษฐี 14 ตารวด!!! ( Let's get Rich )

Using Google Chrome Inspect Element to Analyze the website

Easy way to download whole youtube play list and convert them to mp3