0

What did I do wrong with the declaration part ??

It says ‘i’ was not declared in this scope And ‘a’ was not declared in this scope #include <iostream> using namespace std; int main() { int a[i]={}; while(cin>>a[i]){ cout<< a[i]; } return 0; }

28th Feb 2020, 1:03 PM
Hale Julieanne
Hale Julieanne - avatar
1 Respuesta
+ 4
Well, there is nowhere a variable 'i' to be found, so of course it says it is not declared. As a result, the declaration of 'a' is faulty aswell.
28th Feb 2020, 1:10 PM
Shadow
Shadow - avatar