A
A
Hi,
I have not been able to find an example for using the reinterpret cast. Any
ideas?
Regards,
A
I have not been able to find an example for using the reinterpret cast. Any
ideas?
Regards,
A
A said:Hi,
I have not been able to find an example for using the reinterpret cast. Any
ideas?
A said:Hi,
I have not been able to find an example for using the reinterpret cast. Any
ideas?
Regards,
A
.oO LGV Oo. said:on the other, where a B is expected, you *may* pass a A, with the use of the
reinterpret_cast :
void fct2(B *);
A *pA = new A();
fct2(pA); // compiler error, polymorphism does not apply with downcasting
fct(reinterpret_cast<B *>(pA)); // force the compiler to do what you want
Karl Heinz Buchegger said:On the other hand you can also do:
double* pC;
fct( reinterpret_cast< B* >( pC ) );
ideas?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.