問題:
網上解決方案:
1.沒有加
#include <iostream>
using namespace std;
or
2.包含的庫的順序需要調整一下
//These will not work.
#include <iostream>
using namespace std;
int main () {
cout << "hey" << endl;
return 0;
}
#include <iostream>
#include "stdafx.h"
using namespace std;
int main () {
cout << "hey" << endl;
return 0;
}
//This will do.
#include "stdafx.h"
#include <iostream>
using namespace std;
int main () {
cout << "hey" << endl;
return 0;
}
最終解決方法:我自己的原因(笑。。。orz)
打開iostream文件,我之前因爲一個工程的原因,把部分代碼註釋掉了。。。。(無語中)
取消註釋就好了。