Q:

Can we make a copy constructor private in c++?

0

Can we make a copy constructor private?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Answer:

Yes, a copy constructor can be made private. When we make a copy constructor private in a class, objects of that class become non-copyable. This is particularly useful when our class has pointers or dynamically allocated resources.

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Interview Questions For Experienced

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Can you explain the order of execution in the cons... >>
<< Are Constructors and destructors can declare as co...