标签:bsp pac stack color console i++ ogr div 笔记
using System; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { int a = 5; unsafe { int* pa = &a; Console.WriteLine(*pa); } /************************************************************************/ int[] b = new int[10]; unsafe { fixed (int* pb = b) { for (int i = 0; i < 10;i++ ) { *(pb+i) = i; } } } foreach (int i in b) Console.Write(i); Console.WriteLine(); /************************************************************************/ unsafe { int* s = stackalloc int[5]; for (int i = 0; i < 5;i++ ) { *s=i; s++; } s = s - 5; for (int i = 0; i < 5;i++ ) { Console.Write(*(s+i)); } } Console.Read(); } } }
标签:bsp pac stack color console i++ ogr div 笔记
原文地址:http://www.cnblogs.com/tiandsp/p/7440474.html