2013-03-04 110 views
-2

我有一个嵌套循环,并得到这个错误,但据我所知,我不需要另一个';'在这段代码中语法错误:缺少';'之前')'

while (inFile >> location >> elevation >> precipAmount) 
{ 

    for (count, count <= 12, count ++) 

我在最后一个右括号后出现错误。

+0

要求在此之前尝试专注于学习VISUAL C++的网上资源众人之一。 – 2013-03-04 10:37:08

回答

2

for循环有语法错误,请注意半结肠代替commars的:

for (count; count <= 12; count ++) 
+0

啊,我看到谢谢。 – 2013-03-04 10:35:57

1

尝试

for (count; count <= 12; count ++) 
2

for循环使用;到单独的部件。它应该是

for (count; count <= 12; count++) 

另外,第一部分用于在循环开始前initalise什么。您应该设置count的值或删除它,因为它目前什么都不做

for (; count <= 12; count++) 
// or 
for (count = 0; count <= 12; count++) 
1

for (count; count <= 12; count ++)

相关问题