我先是 int[] a
    然后打算 int[]* p = a;
可程序一直报错,请大虾指教正确的写法。万分感谢

解决方案 »

  1.   

    int[] source = new int[]{41,42,43,44};   
      fixed(int *ptr = &source[0])   
      {   
       int x = *ptr;   
       MessageBox.Show(x.ToString());   
      }
    fixed在unsafe   应用   
      ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/csref/html/vclrfFixed.htm   
        
      IntPtr   
      ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/cpref/html/frlrfSystemIntPtrClassctorTopic.htm   
        
      http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/cpref/html/frlrfSystemIntPtrClassTopic.asp   
      

  2.   

    int[] a..
    IntPtr ptr = Marshal.UnsafeAddrOfPinnedArrayElement (a,0);
      

  3.   

    基础知识普及帖:http://topic.csdn.net/u/20090924/13/235a313c-f906-4fec-bb8f-6555bcc27c58.html