Is it posssible to get the address of a variable in visual basic
I mean something in c++ like
int *ptr;
int a=1;
ptr = &a;
There is no direct equivalent.
Depending on the situation, one of the following solutions may apply:
* Use references instead of pointers (see: reference types, value types,
operators '=', 'Is', 'IsNot').
* Declare the parameter as 'ByRef' when using p/invoke.
* Use 'Marshal.Alloc*' to reserve an unmanaged block of memory and then
use 'Marshal.Write*'/'Marshal.Copy' to copy data to the memory area. Then
you can pass around the pointer pointing to the memory location.
* Use 'GCHandle.AddrOfPinnedObject' to pin a managed object in memory
(rarely useful).