C#直接修改内存
class Program
{
static void Main(string[] args)
{
unsafe
{
int i = 100;
int* j = &i;
*j = 101;
Console.WriteLine("i = " + i);
Console.Read();
}
}
}
注:【运行代码前,请打开项目属性,在生成选项卡里,勾选“允许不安全代码”】
-------------------------------------------------
!!!作者:木由水 http://www.cnblogs.com/muyoushui