title: overriding C++ not working as expected
body: <p>I am new to object oriented programming , so I have a vague understanding of the overriding concept. However , the following example totally confuses me:</p>
  
  <pre><code>class Base {
    public:
      void Hello() {
        cout &lt;&lt; "hello world from the BASE class" &lt;&lt; endl;
      }
  
    void printHello() {
      for (int i = 0; i &lt;= 5; i++) {
        Hello();
      }
    }
  
  };
  
  class Derived: public Base {
    public: void Hello() {
      cout &lt;&lt; "hello world from the DERIVED class";
    }
  };
  
  int main() {
    Derived obj;
    obj.printHello();
    return 0;
  }
  </code></pre>
  
  <p>expected result: 5* "hello world from the DERIVED class"</p>
  
  <p>result:  5* "hello world from the BASE class"</p>
  
  <p>Shouln't the Hello() function in the BASE class be replaced by the one in the DERIVED class?  If not , how can I obtain this?</p>
  
  <p>Thanks in advance!</p>