Re: Assign pointers of different objects to the same pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/07/07, Duft Markus <Markus.Duft@xxxxxxxxxx> wrote:
void* ptr;
// Dynamic cast, checks types at runtime
var1 = dynamic_cast<MyType1*>(ptr);

I'm quite confidant that you can't dynamic_cast from a void*.

( How would it be able to check? It can't. )

Also you may want to look at the other *_cast operators (static_cast,
etc)...

Simple description here:
http://gpwiki.org/index.php/C_plus_plus:Modern_C_plus_plus:Appendices:Casts

~ Scott

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux