Demonstrate stackalloc
using System;
class MainClass {
unsafe public static void Main() {
int* ptrs = stackalloc int[3];
ptrs[0] = 1;
ptrs[1] = 2;
ptrs[2] = 3;
for(int i=0; i < 3; i++)
Console.WriteLine(ptrs[i]);
}
}
Output 1
2
3
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
|