Reply to thread

In main, if I change [code]*a = *b;[/code] to [code]a = b;[/code], everything works as expected. The second "a" output is 7. This make sense in the context of "slicing" from Savitch.


 How do I go about both making a deep copy of b and also maintaining the polymorphism?


A virtual Clone function! Why didn't I think of that?http://www.informit.com/articles/article.aspx?p=31529&seqNum=5  Thanks to everyone who knows the answer but never got a chance to give it... :)


Back
Top Bottom