When to use “new” and when not to, in C++? – Stack Overflow

You should use new when you want an object to be created on the heap instead of the stack. This allows an object to be accessed from outside the current function or procedure, through the aid of pointers. It might be of use to you to look up pointers and memory management in C++ since these are things you are unlikely to have come across in other languages.

Read More