IntelliSense: no statement >> matches these operands

I am trying to understand why I keep getting a compiler error

IntelliSense: the "→" operator does not match these operands

with code below. Would thank any help. thank

#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;
 }
+3
source share
1 answer

Prompt:

cout <<"What is number of resources to be shared?"<<
cin >> n;

Same as:

cout <<"What is number of resources to be shared?"<< cin >> n;

Perhaps it <<should be followed by something like std::endl;, simple or changed to ;.

+4
source

All Articles