I'm looking for a way to perform pointer operations in C# or .NET in particular.
I want to do something very simple
Having a pointer IntPtr I want to get IntPtr object which points to 2 bytes ahead.
I read some post that the foolowing snippet will work...
IntPtr ptr = new IntPtr(oldptr.ToInt32() + 2);
I suggest you to use ToInt64() and long to perform your computation. This way you will avoid problem on 64 bits version of the .NET framework.
IntPtr ptr = new IntPtr(oldptr.ToInt64() + 2);
This add a bit of overhead on 32 bits system, but it is safer.