that's great guys, makes sense.
thanks,
Type: Posts; User: dougieb
that's great guys, makes sense.
thanks,
ok, so just to clarify (so I never need ask again!).
if the program is interrupted, the OS will free up any memory that has been allocated.
if the program exits (finishes, crashes), the OS will...
and the OS does that because it is an interrupt?
whereas if the program completes (and I don't free memory), the OS won't free it for me? thus leading to a memory leak?
PS. actually thinking...
this is excellent. I just set out to find the difference between malloc and declaring variables (and why you don't free variables), and here is it after a short search. I didn't realise the...