foo.cc:3:8: error: expected identifier before numeric constant
3 | int a=[1000],x;
| ^~~~
foo.cc: In lambda function:
foo.cc:3:13: error: expected ‘{’ before ‘,’ token
3 | int a=[1000],x;
| ^
foo.cc: At global scope:
foo.cc:3:7: error: invalid user-defined conversion from ‘<lambda()>’ to ‘int’ [-fpermissive]
3 | int a=[1000],x;
| ^~~~~~
foo.cc:3:7: note: candidate is: ‘<lambda()>::operator void (*)()() const’ (near match)
3 | int a=[1000],x;
| ^
foo.cc:3:7: note: no known conversion from ‘void (*)()’ to ‘int’
foo.cc: In function ‘int main()’:
foo.cc:8:15: error: invalid types ‘int[int]’ for array subscript
8 | cin>>a[i];
| ^
foo.cc:10:16: error: invalid types ‘int[int]’ for array subscript
10 | cout<<a[i]<<" ";
| ^