While we create a copy constructor Is this code coreect or wrong?
class a
{
public:
a(a &b)
{}
}
While we create a copy constructor Is this code coreect or wrong?
class a
{
public:
a(a &b)
{}
}
It should be like ::
class a
{
public:
a(const a &b)
{}
}
i think its working. i will say tomorrow how it works
Copy constructor can be like this
B(const B &b)
{
//initialization
}
ur code is absolutely correct
that code is correct,but if u create a constant object then dt code is not correct,u have to write const classname&,like dt.ok,,,,,,,if u do not write const object then dt code is ok.
What ever u have written that is absolutely correct...