fork(2) download
  1. void test()
  2. {
  3. const size_t Gbyte = 1024 * 1024 * 1024;
  4. size_t i;
  5. char *Pointers[3];
  6. // Allocate
  7. for (i = 0; i != 3; ++i)
  8. Pointers[i] = (char *)malloc(Gbyte);
  9. // Use
  10. for (i = 0; i != 3; ++i)
  11. Pointers[i][0] = 1;
  12. // Free
  13. for (i = 0; i != 3; ++i)
  14. free(Pointers[i]);
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'test':
prog.c:3:9: error: unknown type name 'size_t'
   const size_t Gbyte = 1024 * 1024 * 1024;
         ^
prog.c:4:3: error: unknown type name 'size_t'
   size_t i;
   ^
prog.c:8:5: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
     Pointers[i] = (char *)malloc(Gbyte);
     ^
prog.c:8:27: warning: incompatible implicit declaration of built-in function 'malloc'
     Pointers[i] = (char *)malloc(Gbyte);
                           ^
prog.c:14:5: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]
     free(Pointers[i]);
     ^
prog.c:14:5: warning: incompatible implicit declaration of built-in function 'free'
stdout
Standard output is empty