错误 C2064 — 我不知道我做错了什么

Error C2064 — I don't know what I did wrong

本文关键字:错了 什么 我不知道 C2064 错误      更新时间:2023-10-16

我需要有关此代码的帮助:

#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

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

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

您之前缺少"<<"(可能)。 因此,编译器认为"There are "是你尝试调用的函数。 因此,错误消息"term 不计算为采用 1 个参数的函数"。