New answers tagged memory
0
votes
p is assigned a memory first but when create family is called again, isnt the last memory lost as now p points at a new chunk of memory?
No because you arent calling create family against p you are calling it to assign to parent0 and parent1 then you are assigning those pointers into the parents array of p.
presumably create_family is ...
Top 50 recent answers are included
Related Tags
memory × 74pset5 × 21
speller × 19
valgrind × 18
pset4 × 15
c × 8
memory-leak × 7
recover × 6
malloc × 6
allocation × 6
pointers × 5
dynamic × 5
dictionary × 4
array × 4
cs50x × 3
check50 × 3
error × 3
week4 × 3
general × 3
load × 2
filter × 2
unload × 2
blur × 2
function × 2
variables × 2