fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7.  
  8. int i;
  9. int a[5];
  10.  
  11. for ( i = 0; i < 5; i++) {
  12. a[]=i;
  13. }
  14.  
  15. for (int i = 0; i < 5; i++) {
  16. cout << a[] << endl;
  17. }
  18.  
  19. }
  20.  
  21.  
  22.  
  23.  
Compilation error #stdin compilation error #stdout 0s 15232KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12:5: error: expected primary-expression before ‘]’ token
   a[]=i;
     ^
prog.cpp:16:13: error: expected primary-expression before ‘]’ token
   cout << a[] << endl;
             ^
stdout
Standard output is empty