title: Why do we need virtual functions in C++?
body: <p>I'm learning C++ and I'm just getting into virtual functions.</p>
  <p>From what I've read (in the book and online), virtual functions are functions in the base class that you can override in derived classes.</p>
  <p>But earlier in the book, when learning about basic inheritance, I was able to override base functions in derived classes without using <code>virtual</code>.</p>
  <p>So what am I missing here? I know there is more to virtual functions, and it seems to be important so I want to be clear on what it is exactly. I just can't find a straightforward answer online.</p>