fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. char *foo = {"bar", "fred", "bob"};
  6. printf("%s\n", foo);
  7. return 0;
  8. }
Compilation error #stdin compilation error #stdout 0s 2248KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:5:5: error: excess elements in scalar initializer [-Werror]
     char *foo = {"bar", "fred", "bob"};
     ^
prog.c:5:5: error: (near initialization for ‘foo’) [-Werror]
prog.c:5:5: error: excess elements in scalar initializer [-Werror]
prog.c:5:5: error: (near initialization for ‘foo’) [-Werror]
cc1: all warnings being treated as errors
stdout
Standard output is empty