View Single Post
Old Mar 9th, 2006, 10:08 PM   #2
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
The new keyword allocates your string to the heap. while your first example allocated memory to the stack.

Stack memory is not as readily available as heap memory. Basically, you store memory on the heap with the new and store that adress in a pointer.

Memory on the heap can also be deleted. Using the 'delete' command. Which makes your program run more efficient.

Am I missing any key pointers anyone?
Eric the Red is offline   Reply With Quote