Final answer:
When you define a class with dynamic memory allocation and a destructor but no copy constructor, several consequences occur.
Step-by-step explanation:
When you define a class that uses dynamic memory allocation and define a destructor but no copy constructor, several things happen:
- If an object of the class is passed as a call-by-value parameter in a function, when the function ends, the parameter's dynamic memory is returned to the freestore at the end of the function execution.
- When an object that was used as an argument for a call-by-value parameter goes out of scope, it will cause a run-time error because the destructor will be called to deallocate the dynamic memory twice.
- It is possible to modify the values in the argument of the function, since the object is passed by value.