Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    Why? Because you didn't write virtual my_Func in the base class. That's what virtual means. Or are you really asking, "How can the computer tell what I wrote in the base class?" Commented Feb 3, 2016 at 8:25
  • Yes, I think I should ask how rather then why. Commented Feb 3, 2016 at 8:28
  • I had hoped that this question was about slicing on assignment, but it seems that you've conflated pointers and objects. Commented Feb 3, 2016 at 8:38
  • hmm not assignment really ... I just wanted to know how internally the upcasting works. Commented Feb 3, 2016 at 8:46