Member function declarations with the same name and the nameparameter-type-list cannot be overloaded if any of them is a staticmember function declaration.
Please explain the following point
while making deep copy, why the parameter in copy constructor is Car(Car &C) instead of Car(Car *C). What is the actual difference between both?
hey @mayankA47, try to understand with this example
class Test {
static void fun(int i) {}
void fun(int i) {}
};
int main()
{
Test t;
getchar();
return 0;
}
This Code will give you error
hey @mayankA47, for second query, go through this https://stackoverflow.com/questions/7833224/pointers-arguments-in-copy-constructor
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.