Answered

If obj1 and obj2 are both objects of a class that uses dynamic memory allocation, but the class does not have an assignment operator, what happens if you execute the following code? obj1 = obj2;?

Answer :

mickymike92

If you execute the code obj1=obj2 what happens is that the pointers to the dynamically declared memory in obj2 will be copied to the corresponding pointers in obj1.

What is Dynamic memory allocation?

Dynamic memory allocation is the process of assigning memory space to a variable at the execution time or during the run time.

So in the case where obj1 and obj2 uses dynamic memory allocation but do not have assignment operator and you execute a code obj1=obj2, the pointers in obj2 will be copied to the pointers in obj1.

In conclusion, dynamic memory allocation assigns memory space during the execution time or during the run time.

Learn more about Dynamic memory allocation at: https://brainly.com/question/13566126

#SPJ1

Other Questions