Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
79 / 187
What is dynamic constructor?
Answer:
The constructor can also be used to allocate memory while creating objects.
This will enable the system to allocate the right amount of memory for each object when the objects are not of the same size, thus resulting in the saving of memory;. Allocation of memory to object at the time of their construction is known as a dynamic construction of objects. The memory is allocated with the help of the new operator. The use of new in constructors that are used to construct strings in objects.
Asked In ::
Amit Yadav
23 Feb, 2019 5:07 AM
The constructor can also be used to allocate memory while creating objects.
This will enable the system to allocate the right amount of memory for each object when the objects are not of the same size, thus resulting in the saving of memory;. Allocation of memory to object at the time of their construction is known as a dynamic construction of objects. The memory is allocated with the help of the new operator. The use of new in constructors that are used to construct strings in objects.
This will enable the system to allocate the right amount of memory for each object when the objects are not of the same size, thus resulting in the saving of memory;. Allocation of memory to object at the time of their construction is known as a dynamic construction of objects. The memory is allocated with the help of the new operator. The use of new in constructors that are used to construct strings in objects.