title: reference and pointer used for polymorphism?
body: <p>I studying c++.I am having problem in under standing run time polymorphism ?
  why do we need to use reference / pointer when same work can done by creating object of class?</p>
  
  <p>`for eg:</p>
  
  <pre><code>class A{
  private:
      int p;
  public:
      A(){}   //ctor
      void Print(){}
      void display(){}
      void showrecord(){}
  } 
  class B:public A
  {
  Private:
       int q;
  public:
      B(){}    //ctor
      void Print(){}  
      void displayrecord(){}
  }
  </code></pre>
  
  <p>now in  above case i can access any method of B class by using its object  and A class method b using scope resolution then why to use pointer and assign object to it? </p>