In the computer world, anything that is processed be it an instruction or any data first needs to be loaded and located in internal memory. In C++ programs also any data that is processed while executing the program is held in the internal memory. What is Dynamic Memory Allocation? Dynamic Memory allocation means that the memory that will be used during the program is not known beforehand and is allocated dynamically and on the go. It is allocated during the runtime as and when required by the program. In C++ there are two operators used in dynamic memory allocation 1. New 2. Delete New operator in dynamic memory allocation The new operator in C++ is used to create objects of all types. The new operator will allocate memory of the size of the data type specified in the program. For Example iptr = new int ; Storing initial values will allocate needed amount of memory from the free store to hold the value of the specified data-type and store the startin...
Learn C++ Programming fast and easy, find C++ Program Codes