Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <malloc.h>
- void foo(int** p){
- *p = malloc(sizeof(int) * 1);
- (*p)[0] = 1;
- }
- int main(){
- int* p = NULL;
- foo(&p);
- printf("%d", *p);
- free(p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement