fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main() {
  5. int *foo=malloc(sizeof(int)*4);
  6. for(int i = 0; i < 4; ++i) {
  7. printf("%d ", foo[i]);
  8. foo[i] = i;
  9. }
  10. free(foo);
  11. puts("");
  12. foo = malloc(sizeof(int)*4);
  13. for(int i = 0; i < 4; ++i) {
  14. printf("%d ", foo[i]);
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
0 0 0 0 
0 0 2 3