Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Creating and maintaining dynamic data structures requires dynamic memory allocation, which enables a program to obtain more memory at execution time to hold new nodes. When that memory is no longer needed by the program, the memory can be released so that it can be reused to allocate other objects in the future. The limit for dynamic memory allocation can be as large as the amount of available physical memory in the computer or the amount of available virtual memory in a virtual memory system. Often, the limits are much smaller, because available memory must be shared among many programs.
The new operator takes as an argument the type of the object being dynamically allocated and returns a pointer to an object of that type. For example, the statement