C++20 sections · 1024 units
Open in CourseQuiz: Copy Constructor
Knowledge check
Check Your Understanding
What problem occurs if you rely on the default copy constructor when your class has a pointer member?
- A.The pointer is not copied at all
- B.Both objects share the same memory, causing double-free errors
- C.The pointer becomes null in the copy
- D.The copy constructor doesn't run