C# does support pointers in unsafe code. Also, if you are making calls
to unmanaged code, pointers are represented in with the IntPtr structure (in
safe code), and can be manipulated through various API calls, as well as
calls to the methods on the Marshal class.
You need to use the unsafe keyword, to make a block for the pointer.
unsafe {
fixed (int* pInt = (int*)intArray) {
// work with the pInt here
}
}
This will not be garbage collected.
You may want to think whether you really need pointers, as C# tries
to be safer than C/C++, and not allowing pointers is one of the way to
try to help.