2
爲什麼程序剛剛退出,vs 2012中,而2010年它是否等待我的輸入?C++ getchar在vs 2010中工作,不在2012中
#include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
string path = "c:\somepath";
cout << "Path is" + path << endl;
getchar();
return 0;
}
嘗試刪除'endl'和'\ N'取代它,我覺得這可能幫助http://stackoverflow.com/a/8443105/3871352 – Kiloreux
@Kiloreux以及如何將這項幫助? – piezol
刪除endl並添加\ n沒有幫助 – Muteking