Advertisement
wavec022

lesson 5 pointers

Aug 27th, 2020
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. Stack vs Heap-- stack de-allocates and is fast but cannot be resized; heap has to be allcoated and can memory leak
  2.  
  3. malloc(size): generates array of particular size
  4. calloc(num,size): generates array of num elements, each of size size, and initializes everything to 0
  5. realloc(ptr, size): reallocates size at ptr
  6.  
  7. free(ptr): frees memory of pointer
  8.  
  9. Carl lives in a house, dug points to carl
  10. int carl = 1; int *dug = &carl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement