Skip to content

Instantly share code, notes, and snippets.

@mike-zhang
Created October 24, 2012 15:13
Show Gist options
  • Save mike-zhang/3946678 to your computer and use it in GitHub Desktop.
Save mike-zhang/3946678 to your computer and use it in GitHub Desktop.
使用预处理进行调试(c++ demo)
#include <iostream>
//#define NDEBUG // or : g++ -DNDEBUG debugTest.cpp -o debugTest
#include <cassert>
using namespace std;
int main()
{
cout<<__FILE__<<endl;
cout<<__LINE__<<endl;
cout<<__TIME__<<endl;
cout<<__DATE__<<endl;
assert(1 > 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment