Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
freeing memory
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="SM Ryan, post: 2468858"] # I ask my compiler to carve out memory in main and in a subroutine. The # adage is that if one asks an OS for memory, he must give it back. I # would think that the requested memory in the subroutine would disappear # when the return is made. It would also seem that I've created a memory What makes heap memory like malloc so useful is precisely that the memory is not automatically released when a procedure returns. The normal C malloc does not garbage collect, so it is your responsibility to keep a pointer to each mallocked block until you free it, and not to use the pointer after free. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
freeing memory
Top