Hi, Im relatively new to C++, and in the book im currently reading, came across the topic of Polymorphism. Just wanted to ask a couple of questions:
1) Base* ptr = new sub;
Kinda confused about this - and also, how/why it is useful to have a base class pointer storing the adress of a sub class. Perhaps someone could clear this up for me? :)
2) Virtual functions/methods
Why/how are these useful?
- Shift_ -