first of all not
but
secondly of course you can write
f(ClassA x) {}
ClassB* b = new ClassB;
f(*b);
and your compiler will interpret this in the following way:
f((ClassA)(*b)); // TYPECASTING!!!
And inside f will be called member functions of CalssA even if they are overrided in ClassB.
thridly (MAIN SURPRISE)
all changes applyed to
x inside
f(ClassA x) will not have effect on b!
declaration
f(ClassA x) means that inside
f will be passed temporarry copy of object
*b, which is to be destroyed after exiting from
f.
Try to read some books on c++ and start from passing arguments to functions.
(Excuse my poor english)