zoukankan      html  css  js  c++  java
  • C#指针实例

                unsafe
                {

                    long* a;
                    int* a1 = stackalloc int[5];
                    a1[0] = 1;
                    a1[1] = 2;
                    a1[2] = 3;
                    a1[3] = 4;
                    a1[4] = 5;
                    a = (long*)a1;
                    Console.WriteLine(*a);
                    for (int i = 0; i < 2; i++)
                    {
                        Console.WriteLine(*(a + i));
                        Console.WriteLine(*(a1 + i));
                    }
                    int[] b1 = { 10, 11, 12, 13, 14 };
                    fixed (int* bb = &b1[0])
                    {
                        for (int i = 0; i < 5; i++)
                        {
                            Console.WriteLine(*(bb + i));
                        }
                    }

                }

  • 相关阅读:
    Dragon Balls_并查集
    Farm Irrigation_并查集||dfs
    The trouble of Xiaoqian_多重背包&&完全背包
    Difference Is Beautiful
    Bone Collector II_第k大背包
    Dividing_多重背包
    Milk
    coins_多重背包
    钱币兑换问题_完全背包&&拆分&&母函数
    多项式链表多项式相加
  • 原文地址:https://www.cnblogs.com/niezl/p/5881724.html
Copyright © 2011-2022 走看看