AgPro

导航

#error的作用

#error

Syntax:

  #error message

The #error command simply causes the compiler to stop when it is encountered. When an #error is encountered, the compiler spits out the line number and whatever message is. This command is mostly used for debugging.

#define ab "hello"
#ifdef ab
#error "ab has been defined."
#endif

//编译的时候自己可以看到出错信息

posted on 2010-06-11 15:14  AgPro  阅读(1162)  评论(0编辑  收藏  举报