fork(2) download
  1. int printHelloWorld() { printf("Hello World"); return 0; }
  2. static int testVar = printHelloWorld();
  3. int main ()
  4. {
  5. return 0;
  6. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'printHelloWorld':
prog.c:1:25: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
 int printHelloWorld() { printf("Hello World"); return 0; }
                         ^
prog.c:1:25: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:1:25: note: include '<stdio.h>' or provide a declaration of 'printf'
prog.c: At top level:
prog.c:2:22: error: initializer element is not constant
 static int testVar = printHelloWorld();
                      ^
prog.c:2:12: warning: 'testVar' defined but not used [-Wunused-variable]
 static int testVar = printHelloWorld();
            ^
stdout
Standard output is empty