Click here to Skip to main content
15,922,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating an object:
MyClass a= new MyClass();

I want to get what adress is present in object a.
mean to which memory location it is pointing
Updated 16-Feb-12 1:37am
raghubansh kumar 16-Feb-12 7:27am    
ok but i want dat value

i think it will get assigned with memory address like xx00ee octal or hexadecimal format
Share this answer
raghubansh kumar 16-Feb-12 7:22am    
O.k but i want to get that value .
prajaktakarmarkar 16-Feb-12 7:54am    
only address of memory gets stored in Heap. There is command like AddressOf in .net. go through following links
In unsafe mode, use &.

Normally, you can create a GCHandle[^], of type Pinned, to any object and then call AddrOfPinnedObject on it to find where it was pinned.

But you should never need to do this, except for debugging some very technical interop stuff. So you really need to explain why you think you need this value, because it's almost certainly not the case.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900