Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
In cpp new is an operator used to reserve memory from the heap. It returns a pointer. int *pInt; // declares a pointer to an integer pint = new (int); // reserves memory in the heap for an integer, and assigns its address to pint. new is normally used when memory needs to be reserved during run-time.
13th Feb 2017, 6:07 PM
Francisco Gonzalez
Francisco Gonzalez - avatar