class parent
{
  public:
    virtual void print()
    {
      printf("STUFF");
    }
};
class child : public parent
{
   public:
     virtual void print()
     {
        printf("other stuff");
     }
 };
 int main()
 {
    parent par = new child;
    par.print();
  }
When ever I try this, it always uses the parent function instead of the child function. I was trying to get it to use the child function instead.
 
     
    