1

Possible Duplicate:
Overloading unary operator &

class A
{
public:
    A* operator&()
    {
        return NULL;
    }
};
int main()
{
    A obj;
    A* ptr=&obj;//ptr=NULL
    //determining obj's address here
}

It is possible to determine address of object of such class?

Deduplicator
  • 43,322
  • 6
  • 62
  • 109
eXXXXXXXXXXX2
  • 1,510
  • 1
  • 17
  • 31
  • 1
    [Overloading unary operator &](http://stackoverflow.com/questions/6410333/overloading-unary-operator) – mange Dec 15 '11 at 06:57

0 Answers0