C#不安全代码检索数据值

using System;namespace UnsafeCodeApplication {class Program {public static void Main() {unsafe {int var = 20;

编程学习网为您整理以下代码实例,主要实现:C#不安全代码检索数据值,希望可以帮到各位朋友。

using System;

namespace UnsafeCodeApplication {

   class Program {

      public static voID Main() {

         unsafe {
            int var = 20;
            int* p = &var;
            Console.Writeline("Data is: {0} " , var);
            Console.Writeline("Data is: {0} " , p->ToString());
            Console.Writeline("Address is: {0} " , (int)p);
         }

         Console.ReadKey();
      }
   }
}

本文标题为:C#不安全代码检索数据值

基础教程推荐