when any member function receives a class type argument then also COPY CONSTRUCTOR is called ???
And if yes then then reference of this copy in first place of I mean reference of this new copy argument is sent to copy constructor?
Copy constructor doubt
Yes
If member function is func(dummyclass a)
Here dummyclass is our class , and we are calling from main by passing object c
then a calls copy constructor to copy c in it
So reference of c is passed to copy constructor.
If this resolved your doubt then please mark it as resolved 
If I write a parameterized constructor and not a default constructor and create an object in which no parameter is passed so a default constructor i.e., paramterlesss constructor would be created or not OR IT WILL BE A COMPILE ERROR ??
Can u please provide me code snippet
I am not able to understand this way
What is the output of following program?
#include <iostream>
using namespace std;
class Point
{
int x, y;
public :
Point( const Point &p) { x = p.x; y = p.y; }
int getX() { return x; }
int getY() { return y; }
};
int main()
{
Point p1;
Point p2 = p1;
cout << "x = " << p2.getX() << " y = " << p2.getY();
return 0;
}
This will give error because there is no such constructor with 0 args( The one provided by default is destroyed because u created a copy constructor)
that means when we define any one of constructor i.e., DEFAULT, COPY, PARAMETERIZED so other two get destroyed ? so i should define all 3 if I do any one ?
No, if u dont define any constructor then compiler provides u one i.e empty default constructor
But when u create any of them or all of them yourself i.e code them then the one which compiler provided was destroyed.
in above question I didnt defined my own default constructor then why it got destroyed then???
When an object of the class is returned by value copy constructor is called ? WHY?
There id a copy constructir in class that why the default which compiler provided is destroyed
The copy constructor is called because you call by value not by reference. Therefore a new object must be instantiated from your current object
Refer to this for more detail : https://stackoverflow.com/questions/16731782/why-is-the-copy-constructor-called-when-we-return-an-object-from-a-method-by-val
This will give error because there is no such constructor with 0 args( The one provided by default is destroyed because u created a copy constructor)
I haven’t found any relevance to your this statement that copy constructor destroys default constructor I googled it
If we write any constructor, then compiler doesn’t create the [default constructor] It is not true other way, i.e., if we write a default or parameterized constructor, then compiler creates a copy constructor.
Bro I am not saying user defined default constructor will get destroyed
I am saying default constructor which compiler provides will get destroy
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.