Fixing Managed Data in Memory
using System;
public class MyClass
{
public unsafe static void Main()
{
int ArrayIndex;
int [] IntegerArray;
IntegerArray = new int [5];
fixed(int * IntegerPointer = IntegerArray)
{
for(ArrayIndex = 0; ArrayIndex < 5; ArrayIndex++)
IntegerPointer[ArrayIndex] = ArrayIndex;
}
for(ArrayIndex = 0; ArrayIndex < 5; ArrayIndex++)
Console.WriteLine(IntegerArray[ArrayIndex]);
}
}
|
HTML code for linking to this page:
Related in same category :
-
|