Copy assignment operator and copy constructor operator doubt

If the constructor is defined explicitly then, the compiler will not define the constructor implicitly
is it true ???

is it also true for copy assignment operator and copy constructor operator, that if we create copy assignment operator or copy constructor operator, the copiler will not define the default one
and if we define different copy assignment or contructor operator and tend to use the default one, will it give error

please answer all questions seperately, i am very confused …

yes this is true
you can test it by creating class and constructor
look at this code


this is how we use copy constructor
what is your doubt in this ??
plz explain your 2nd doubt

yaah !! i got most of the second doubt but clear me last

for constructor if we make our own constructor than complier will not make the default one . but the default copy assignment and copy constructor should be there na irrespective of whether the constructor is defined or not ??

Yes

If we don’t define our own copy constructor, the C++ compiler creates a default copy constructor for each class which does a member-wise copy between objects. The compiler created copy constructor works fine in general. We need to define our own copy constructor only if an object has pointers or any runtime allocation

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.