void SomeFunc(ClassA **inst)
{
...
}
Class ClassA
{
...
}
Class ClassB: public ClassA
{
...
}
main
{
ClassA *instA = new ClassB();
SomeFunc(&instA); // this compiles and works fine
ClassB *instB = new ClassB();
SomeFunc(&instB); // but this will not compile
}
I tried a static cast but still could not get to compile
here is what the complier is grippin about:
cannot convert `ClassB*' to `ClassA**' for argument
SomeFunc((ClassA **)&instB);
should work.
Why do you need to pass a pointer to a pointer? Are you going to modify where the pointer points to?
Are you going to modify where the pointer points to?
No. This was more of an exercise in pointer/address gymnastics which I need lots of practice in.