这段代码给了我错误:
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
int main()
{
string name;
cout << "enter your name: "<<endl;
cin >> name;
cout << name << endl;
return 0;
}
错误是:错误 LNK1104 无法打开文件 'c:\users\payman\documents\visual studio 2015\Projects\ConsoleApplication2\Debug\ConsoleApplication2.exe'
但是如果我注释掉第一个 cout 语句,它就可以工作。不明白为什么。