我试图弄清楚为什么我一直得到编译器错误
智能感知:没有运营商“>>”匹配这些操作数
使用以下代码。非常感谢任何帮助。谢谢
#include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;
int main(void)
{
int n;//number of resources we will be dealing with
cout <<"What is number of resources to be shared?"<<
cin >> n;
return 0;
}
答案 0 :(得分:4)
提示:
cout <<"What is number of resources to be shared?"<<
cin >> n;
与:
相同cout <<"What is number of resources to be shared?"<< cin >> n;
<<
或许std::endl;
之后应该跟;
之后,或者更改为{{1}}。