Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int *random_func(){ // if remove * and recompile it, still works fine.
  4. int arr[2] = {12,13};
  5. int *point = (int*) malloc(2*sizeof(int));
  6. point= arr;
  7. return point;
  8. }
  9.  
  10. main(){
  11. int *ptr;
  12. ptr=fun();
  13. printf("%d %d ",*(ptr), *(ptr+1));
  14. return 0;
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement