Reputation: 6545
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
cout <<"What is number of resources to be shared?"<<
cin >> n;
return 0;
}
Upvotes: 3
Views: 4776
Reputation: 503873
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 ;
.
Upvotes: 4