When I dynamically allocate mem within a function, do I have to still manually release it? Or does it go away once the function has run and returned (like local variables)?
If I do have to release it, since it's basically a pointer can I do that from main? Do I have to return the address to release it from outside the function?
I'm assuming that once the memory has been allocate, no matter from where, it must still be manually release, and the address must be passed to do this.