#define DEBUG
#ifdef DEBUG
调试代码
#endif
#include<iostream>
#include <string>
using namespace std;
bool debug =false;
int main(int argc,char*argv[])
{
  for(int i=0;i<argc;i++)
   if(string(argv[i])==“--debug=on“)
   debug = true;
   bool go=true;
   while(go)
   {
    if(debug)
    {
     调试代码
    }else {}
   }
}
#define PR(x) cout<<#x”=”<<x<<'/n'
     4、c语言的assert()       该宏在中,,当使用assert时候,给他个参数,即一个判读为真的表达式。预处理器产生测试该断言的代码,假如断言不为真,则发出一个错误信息告诉断言是什么以及它失败一会,程序会终止。 
#include< assert>
using namsapce std;
int main()
{
  int i=100;
  assert(i!=100);
//Fails
}
 更多内容请看C/C++进阶技术文档  Office技巧专区专题,或
 更多内容请看C/C++进阶技术文档  Office技巧专区专题,或新闻热点
疑难解答