我有一个嵌套循环,并得到这个错误,但据我所知,我不需要另一个';'在这段代码中语法错误:缺少';'之前')'
while (inFile >> location >> elevation >> precipAmount)
{
for (count, count <= 12, count ++)
我在最后一个右括号后出现错误。
我有一个嵌套循环,并得到这个错误,但据我所知,我不需要另一个';'在这段代码中语法错误:缺少';'之前')'
while (inFile >> location >> elevation >> precipAmount)
{
for (count, count <= 12, count ++)
我在最后一个右括号后出现错误。
你for
循环有语法错误,请注意半结肠代替commars的:
for (count; count <= 12; count ++)
啊,我看到谢谢。 – 2013-03-04 10:35:57
尝试
for (count; count <= 12; count ++)
for
循环使用;
到单独的部件。它应该是
for (count; count <= 12; count++)
另外,第一部分用于在循环开始前initalise什么。您应该设置count
的值或删除它,因为它目前什么都不做
for (; count <= 12; count++)
// or
for (count = 0; count <= 12; count++)
写for (count; count <= 12; count ++)
要求在此之前尝试专注于学习VISUAL C++的网上资源众人之一。 – 2013-03-04 10:37:08