fork(6) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. typedef struct {
  6. int type;
  7. void* info;
  8. } Data;
  9.  
  10. Data* insert_data(int t, void* s)
  11. {
  12. Data * d = malloc(sizeof(Data));
  13. d->type = t;
  14. d->info = s;
  15.  
  16. return d;
  17. }
  18.  
  19. struct X { int i; };
  20.  
  21. int main()
  22. {
  23. struct X x;
  24. Data* d = insert_data(1, &x);
  25. free(d);
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0.02s 1848KB
stdin
Standard input is empty
stdout
Standard output is empty