Would appreciate clarification on what exactly is happening when a constructor has only one argument and it is said that it does an implicit cast to the class type - right there It is confusing to me because :
class dog {
public :
dog(string name) { mname = name;}
private :
string mname;
};
I don't understand how a type string can be converted to a type dog, I can see how it can be passed in and SET another string but if a string is converted to type dog what would that even mean? Would it be type dog that gets assigned a bit wise copy of a string?
No comments:
Post a Comment