int* fib= stackalloc int[100];//Alloc memory for int[100] in stack
int* p=fib;
//let pointer p point to the same address as fib pointed to
*p++ = *p++=1; // p++; *p=1; p++; *p=1;

解决方案 »

  1.   

    sizeof(long): There "long" must be a type.
    if you want get length of a string,you should use the "Length" property of the string class.
      

  2.   

    string,char[],array[] ...
    can't sizeof
      

  3.   

    class C1
    {
    static void Main()
    { unsafe
    {
    string str1="long";
    Console.WriteLine("siaeof long is {0}",sizeof(str1));
    }
    }
    }
    可以将以上的例子改为:
    using System;
    class C1
    {
    static void Main()
    { unsafe
    {Console.WriteLine("sizeof long is {0}",sizeof(long));
    }
    }
    }
    就可以编译运行通过。
    得到的结果:sizeof long is 8.