fork download
  1. #include <stdlib.h>
  2.  
  3.  
  4. int main() {
  5. int a[2] = { 22, 33};
  6. for(auto d:a){
  7. printf("%d", d);
  8. }
  9. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:6:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
  for(auto d:a){
            ^
prog.c:6:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
  for(auto d:a){
  ^
prog.c:6:2: note: use option -std=c99 or -std=gnu99 to compile your code
prog.c:7:3: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
   printf("%d", d);
   ^
prog.c:7:3: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
prog.c:7:16: error: ‘d’ undeclared (first use in this function)
   printf("%d", d);
                ^
prog.c:7:16: note: each undeclared identifier is reported only once for each function it appears in
prog.c:5:6: warning: unused variable ‘a’ [-Wunused-variable]
  int a[2] = { 22, 33};
      ^
prog.c:9:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
stdout
Standard output is empty