Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assume p is a private pointer member of class DeepClass that gets assigned dynamically allocated data in one or more of DeepClass 's instance methods.
Assume p is a private pointer member of class DeepClass that gets assigned dynamically allocated data in one or more of DeepClass's instance methods. p controls this dynamically allocated memory. Check all that apply.
A. | A non-destructor instance method of DeepClass may not deallocate the memory that p controls. | |
B. | The memory that p controls will be deallocated when a DeepClass object goes out of scope if an appropriately written user-defined destructor is provided for DeepClass. | |
C. | The memory that p controls will be deallocated when a DeepClass object goes out of scope automatically by C++'s default destructor. | |
D. | Memory that p controls must be allocated at object construction. | |
E. | A user-defined destructor of DeepClass can deallocate the memory that p controls. |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started