|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.learn - Getting the address of the class object
Coming from C++, I wonder whether it is ever needed to get the address
of the object? If so, how?
The & operator below produces the address of the class reference
(variable). How about the class object?
class C
{}
void main()
{
auto variable = new C;
auto address = &variable;
}
Thank you,
Ali
Jan 11 2010
Ali Çehreli Wrote:Coming from C++, I wonder whether it is ever needed to get the address of the object? If so, how? Jan 11 2010
bearophile wrote:Ali Çehreli Wrote:Coming from C++, I wonder whether it is ever needed to get the address of the object? If so, how? Jan 11 2010
|