当前位置:编程学习 > 网站相关 >>

编写非安全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(); 
    } 
}

补充:综合编程 , 安全编程 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,