C++调试暂停语句
在C++編程Debug時,有時需要看執行文件輸出的結果,但往往exe執行文件運行后,就直接退出了,導致無法看到文件的輸出結果。
這時,需要在程序結束前,使用暫停語句,從而可以看到輸出結果。
這里暫停語句為:
system("pause")需要掛的庫為:
#include <stdlib.h>實例演示程序:
#include <iostream> #include <stdlib.h> using namespace std;int main() {cout << "I am a handsome boy!" << '\n';system("pause"); }輸出結果:
?
總結
- 上一篇: HashMap碰撞问题解析
- 下一篇: 第2次实验——算法基本功 与 综合思考