-5

Why wouldn't the following code compile? Basically what is not right in the following code? I'm assuming that declaring the same variable twice without assigning any value would be the problem.

#include <iostream>
using namespace std; int foo() { return 1; }
int main() { int a; int a; cout << foo() << endl; return 0;}  
4

1 回答 1

1

删除一个“int a;” 宣言。即使有可能,也没有理由这样做。

于 2013-10-03T18:18:47.840 回答