2011-05-06 44 views
3

我试图找出为什么我不断收到编译器错误智能感知:没有操作员>>这些操作数

智能感知相匹配:无操作“>>”匹配这些操作数

与下面的代码。希望得到任何帮助。由于

#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; 
} 

回答

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;,只是或改为;