编写非安全C#代码例子
编写非安全C#代码例子
view plaincopy to clipboardprint?
·········10········20········30········40········50········60········70········80········90········100·······110·······120·······130·······140·······15001.using System;
class Test {
int i = 110;
public static void Main() {
Test test = new Test();
unsafe {
fixed (int* p = &test.i) {
*p = 120;
}
}
Console.Write(test.i);
Console.ReadKey();
}
}
补充:综合编程 , 安全编程 ,