Hello,
1) I commented this, because I am not able to compile.

If you want to use constructor, you should use standard declaration like:
class ClassB : public ClassA
{
public:
ClassB(int startValue)
{
this->fStartValue = startValue;
}
int sum()
{
return fStartValue = 10;
}
private:
int fStartValue;
};
2) I finally did it the way you want. The reason, why I was not able to compile it before was inheritance. If class A is inherited by ClassB, you can simply write pObjectA = &objectB; Please see code bellow:
//This code is out of main function
ClassA* pObjectA;
ClassB objectB(10);
//This code is in main function
int total = 0;
pObjectA = &objectB;
total = pObjectA->sum();
After sum is called, number 10 is stored in variable total.
If you have any other questions, please feel free to write me back.
Regards,
Martin