|
using System;
class MyClass {
public static void Main() {
TestClass Obj = new TestClass();
Obj.fun();
}
}
class TestClass {
public unsafe void fun() {
int [] iArray = new int[10];
// store value in array
for (int iIndex = 0; iIndex < 10; iIndex++) {
iArray[iIndex] = iIndex * iIndex;
}
// get value from array
fixed(int* pInt = iArray)
for (int iIndex = 0; iIndex < 10; iIndex++) {
Console.WriteLine(*(pInt + iIndex) );
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.