Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- typedef struct {} t_test;
- void Change(t_test * a)
- {
- a = malloc(sizeof(t_test));
- }
- void Change2(t_test ** a)
- {
- *a = malloc(sizeof(t_test));
- }
- int main()
- {
- t_test * a = malloc(sizeof(t_test));
- t_test * tmp = a;
- Change(a);
- printf("%d\n", a == tmp);
- Change2(&a);
- printf("%d\n", a == tmp);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment