In one C# maintenance project I came across following variable declaration:
Int32* iProgressAddress;
Is it pointer declaration in C#?
I thought that there is no pointer concept in C#, what does that statement mean?
In one C# maintenance project I came across following variable declaration:
Int32* iProgressAddress;
Is it pointer declaration in C#?
I thought that there is no pointer concept in C#, what does that statement mean?
C# does support pointers, but it's limited to pointing to primitive data types that are unmanaged types, such as ints, floats, enums, and other pointer types (plus the rest of the primitives).
edit: as well as value types
Yes, it is.
Notice, that the method is marked unsafe
. As well as the assembly.
There is a lot of things to know before using pointers from the managed code. For instance, pointer pinning.
I'm sorry, I'm afraid that's a pointer, and you have to get used to it.
REALLY! Pointers aren't that scary. :)
This link might also help : http://stackoverflow.com/questions/584134/should-you-use-pointers-unsafe-code-in-c