Advertisement
Guest User

Untitled

a guest
Apr 24th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int *ptr_one;
  6.  
  7. ptr_one = (int *)malloc(sizeof(int));
  8.  
  9. if (ptr_one == 0) {
  10. printf("ERROR: Out of memory\n");
  11. return 1;
  12. }
  13.  
  14. *ptr_one = 25;
  15. printf("%d\n", *ptr_one);
  16.  
  17. free(ptr_one);
  18.  
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement