Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct test {
- void * ptr;
- }
- struct test * create_test (void * ptr) {
- struct test * t;
- t = malloc(sizeof(struct test));
- t->ptr = ptr;
- printf("create_test : t->ptr = %pn", t->ptr);
- return t;
- }
- int main() {
- struct test * t;
- int num;
- num = 5;
- t = create_test((void *) &num);
- printf("main : t->ptr = %pn", t->ptr);
- return 0;
- }
Add Comment
Please, Sign In to add comment