Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int *random_func(){ // if remove * and recompile it, still works fine.
- int arr[2] = {12,13};
- int *point = (int*) malloc(2*sizeof(int));
- point= arr;
- return point;
- }
- main(){
- int *ptr;
- ptr=fun();
- printf("%d %d ",*(ptr), *(ptr+1));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement