I want to get pointer of first entry in the array. This is how I tried
int[] Results = { 1, 2, 3, 4, 5 };
unsafe
{
int* FirstResult = Results[0];
}
Get following compilation error. Any ideas how to fix it?
You can only take the address of an unfixed expression inside of a fixed statement initializer
The error codes are magic to get the answer - search for error code (CS0212 in your case) and you get explanation with proposed fix in a lot of case.
Search: http://www.bing.com/search?q=CS0212+msdn
Result: http://msdn.microsoft.com/en-us/library/29ak9b70%28v=vs.90%29.aspx
Code from the page:
The error message is pretty clear. You can refer to MSDN.
Try this: