class person { std::string name; int age; public: person(const std::string& name, int age) : name(name), age(age) { } }; int main() { person a("Bjarne Stroustrup", 60); person b(a); // What happens here? b = a; // And here? } Why constructor with 2 argument parameter accepts copy object as parameter. We calling constructor with 1 argument person b(a) with different type and it works?
How ?