Guest User

Untitled

a guest
Feb 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. struct test {
  2. void * ptr;
  3. }
  4.  
  5. struct test * create_test (void * ptr) {
  6. struct test * t;
  7.  
  8. t = malloc(sizeof(struct test));
  9.  
  10. t->ptr = ptr;
  11. printf("create_test : t->ptr = %pn", t->ptr);
  12.  
  13. return t;
  14. }
  15.  
  16. int main() {
  17. struct test * t;
  18. int num;
  19.  
  20. num = 5;
  21.  
  22. t = create_test((void *) &num);
  23. printf("main : t->ptr = %pn", t->ptr);
  24.  
  25. return 0;
  26. }
Add Comment
Please, Sign In to add comment