+ 1
What's wrong with this simple C++ code?
Why will this code give an error? #include <iostream> using namespace std; int main() { for (x=5;x<12;x++) { cout <<x; } } Is it because the variable x was not declared? Any other reasons?
4 odpowiedzi
+ 2
Yes, undefined variable <x> is the cause.
+ 2
use it :
for(int x = 5;x<12;x++)
+ 1
The datatype of x not defined any where.