title: cast child class into parent class
body: <p>this is just a sample code</p>
  
  <pre><code> class parent{ //abstact class
          //pure virtual function
          virtual fun=0;
      }
      class child : parent{
          fun;
      }
      main()
      {
             //what should i do here,so i can add parent in vector
          attach(child);
      }
      void attach(parent* p){
          vector.push_back(p); //want to add reference of parent into vecotr
      }
  </code></pre>
  
  <p>and i want to cast child into parent but not able 
  to do please any one help me?</p>