Getting the address of the class object

Ali Çehreli acehreli at yahoo.com
Mon Jan 11 15:46:41 PST 2010


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


More information about the Digitalmars-d-learn mailing list