I am using an example from Sams Teach Yourself C++ In One Hour a day. I pretty much understand concepts relating to the copy constructor. A couple of things that I can use a hand on are;
Why can I put just a string in the
UseMyString("string");
an instance of a MyString object is called sayHello is legal
Unless you make a constructor "explicit" it acts as a conversion function. So UseMyString("hello") first calls the MyString ctor that takes a string literal, creates a MyString object, and passes it to UseMyString. If you put the keyword "explicit" in front of the first MyString ctor then it won't be used implicitly like that.