|
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?
|