Assigning temporary object to the invoking object
I'm doing an exercise from a book. I have a class (named Golf) and one of
its the functions should pass some data to the constructor to create a
temporary object, and assign the temporary object to the invoking object,
which is *this. Now I tried this:
*this = Golf(fullname, handicap);
but it doesn't work. I haven't found any sollution on the internet. How
should I do this?
No comments:
Post a Comment