DEV Community

Discussion on: Dynamic memory allocation in C

Collapse
 
tomlankhorst profile image
Tom Lankhorst

Things such as function arguments and local variables are stored in the heap, and the memory is automatically freed when a function ends.

You probably meant on the stack here.

Collapse
 
mikkel250 profile image
mikkel250

I did, thanks for the catch!