2016-06-09 77 views
-5

我需要这个代码帮助:错误C2064 - 我不知道我做错了什么

#include "stdafx.h" 
#include <iostream> 
#include <string> 
#include <vector> 
#include <ctime> 
#include <cstdlib> 
#include <iterator> 

using namespace std; 
using namespace System; 

int possibleOres;//int für die möglichen Erze 

vector<string>::iterator Ore; //Iterator um das Ore auszuwählen 
vector<string>::iterator Iter; //iterator deklariert 
for(Iter = OreList.begin(); Iter != OreList.end(); Iter++) 
{ 
    possibleOres++; 
} 
cout << "There are " (possibleOres) <<" possible Ores."; //this part does not work 

我搜索与谷歌已经和搜索这个网站,但我没有找到答案我可以使用。我有一个载有不同Ores的矢量,我尝试数数并显示它。我在另一个程序中尝试了这种代码,它工作得很好。

+2

你在''和'(possibleOres)之间缺少一个'<<'' – CoryKramer

+1

你在'cout <<'这一行中缺少'<<'There are“(possibleOres)< <'('(')之前) –

+1

当您询问有关错误消息的问题时,请在问题中包含错误消息。并非每个人都有您的特定编译器,但是如果您有许多人可以解释错误消息显示它(并且解释消息通常比扫描代码找到原因更容易)。 –

回答

2
cout << "There are " (possibleOres) <<" possible Ores." 

你错过了 “< <” 之前(possibleOres)。因此,编译器认为"There are "是您试图调用的函数。因此,错误信息“术语不会评估为带有1个参数的函数”。