IntelliSense: no operator >> matches these operands
I am trying to figure out why I keep getting the compiler error
IntelliSense: no operator ">>" matches these operands
with the code below. Would appreciate any help given. Thanks
#include "stdafx.h"
#include <string>
#include <iostream>
using namespace std;
int main(void)
{
int n;//number of resources we will be dealing with
开发者_JAVA百科 cout <<"What is number of resources to be shared?"<<
cin >> n;
return 0;
}
Hint:
cout <<"What is number of resources to be shared?"<<
cin >> n;
Is the same as:
cout <<"What is number of resources to be shared?"<< cin >> n;
Perhaps <<
should be followed by something like std::endl;
, just or changed to a ;
.
精彩评论