📄 debug2.cpp
字号:
//: C03:Debug2.cpp
// From Thinking in C++, 2nd Edition
// at http://www.BruceEckel.com
// (c) Bruce Eckel 1999
// Copyright notice in Copyright.txt
// Framework for writing debug code
#include <iostream>
#include <fstream>
#include <cstdlib>
using namespace std;
#define DEBUG
int main(int argc, char * argv[]) {
int debug = 0;
if(argc > 1) { // If more than one argument
if (*argv[1] == 'd')
debug++; // Set the debug flag
else {
cout << "usage: debug2 OR debug2 d" << endl;
"optional flag turns debugger on.";
exit(1); // Quit program
}
}
// ....
#ifdef DEBUG
if(debug)
cout << "debugger on" << endl;
#endif // DEBUG
// ...
} ///:~
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -