How can I overload char*? [duplicate]
问题 This question already has answers here : How to pass optional arguments to a method in C++? (7 answers) Closed 6 months ago . I was asked that in a method class receive a char* and copy that in the member of the class, and if I don´t receive any parameter assign "Sin nombre" to the parameter void VEHICULO::Set_Nombre(const char* c){ //No problem here } int main(){ VEHICULO a; a.Set_Nombre("FERRARI");//ITS OK a.Set_Nombre(); //the class doesnt know that method } know how to copy the passed