Say the class B inherits from class A and class A contains a virtual function
virtual public foo() {cout<<"I'm A"<< endl';}
while B contains
public foo() {cout<<"I'm B" << endl';}
Why is it that
A* x = new B;
will let x use the function foo() where it prints out "I'm B", but
A x = B;
would give me the other function?