Pointer to Object Questions
Jarrett Billingsley
kb3ctd2 at yahoo.com
Mon Jan 1 09:12:35 PST 2007
"John Kiro" <johnkirollos at yahoo.com> wrote in message
news:enavsd$49l$1 at digitaldaemon.com...
> As a summary:
>
> - CObj obj2=obj1;
>
> obj2 is a reference to obj1 (both obj1 & obj2 refer to the same
> object). So no new object is created.
>
> - CObj* pRefObj1=&obj1;
>
> pRefObj1 is the address of the reference of the object, not a
> pointer to the object itself.. TAKE CARE!
>
> - void* pObj1=cast(void*)obj1;
>
> pObj1 is a pointer to the object itself (as object pointers in
> C++)
Right on all counts.
More information about the Digitalmars-d-learn
mailing list