fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int n,i;
  4. int g[n];
  5. int main()
  6. {
  7. scanf ("%d", n);
  8. malloc(n);
  9. for (i=1; i=n; i=i+1)
  10. {
  11. printf("%s",g[i]);
  12. }
  13. return 0;
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:4: error: array bound is not an integer constant
prog.cpp: In function ‘int main()’:
prog.cpp:7: warning: format ‘%d’ expects type ‘int*’, but argument 2 has type ‘int’
prog.cpp:9: warning: suggest parentheses around assignment used as truth value
prog.cpp:11: error: ‘g’ was not declared in this scope
prog.cpp:7: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result
prog.cpp:8: warning: ignoring return value of ‘void* malloc(size_t)’, declared with attribute warn_unused_result
stdout
Standard output is empty