预处理更多例子。
你可以这么写:
1.
#if SOMETHING>=100
//...
#else
//...
#endif
2.
#ifndef SOMETHING_H
#define SOMETHING_H
//...
#endif
3.
#if (defined DEBUG)&&(defined SOMETHING)
//...
#endif
4.
#ifdef SOMETHING
int func1(){/*...*/}
#else
int func1(){/*...*/}
#endif
5.
#ifdef SOMETHING
namespace space1{
#endif
//...
#ifdef SOMETHING
}//space1
#endif