Is this a right way to do it in C++?Code:class base { public: char m; } class derived : public base { public: char c; } void somefunc(base **bc) { } int main() { derived *ptr = 0; somefunc(reinterpret_cast<base**>(&ptr)); return 0; }
Normally I would just do somefunc((base**)&ptr); and it would work just fine..
I tried dynamic_cast but it didnt work.



LinkBack URL
About LinkBacks



CornedBee