I don´t know how to get the adress of the class inside itsel

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Adek336

I don´t know how to get the adress of the class inside itsel

Post by Adek336 »

How can I tell what adress is this specific instance of the class?

class foo
{
public:
long bar();
};

long foo::bar()
{
return SOME_MAGIC_OPERATOR;
}

foo my_foo;

and my_foo.bar() would return &my_foo. Is this possible?

Cheers,
Adrian.
Jamethiel

RE:I don´t know how to get the adress of the class inside it

Post by Jamethiel »

Well, let's see...

It's going to be one of myself, Me, self, or this. Probably the latter.

Enjoy.
Adek336

RE:I don´t know how to get the adress of the class inside it

Post by Adek336 »

it is ´this´! I misunderstood a tutorial and I thought ´this´ points at the method which accesses it.

Thanx,
Adrian
Post Reply