0

Hi, everyone.
Well, I have a problem.
There's a class A with a member int a, and don't know any other information about A.
Now there's an object MA of A, but I just know the address of MA.a,
how can I get the address of MA?
Thanks a lot.

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by MrSpigot
0

There are no language constructs to get the address of an object from the address of a member. Your compiler will manage the memory in the class as it sees fit so unless you want to get down and dirty with your compiler, which I'm not recommending, you can't do it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.