2011-05-06 43 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;,只是或改爲;