Quote:
Originally Posted by
JamesGoh
(even though for some odd reason, the code segment above created no dramas when placed in a local func that returned a char ptr)
The pointer may be pointing to some memory that has not been trashed yet, but is not safe.
Memory in global data is permenant, it is forever for the life of the program.
Memory on the stack is only for the life of the function in which it is declared.
Memory on the heap is dynamic, long last and can be allocated when needed and free, main issue is time it takes to allocate and free, a performance thing, and also fragmentation.