请问如何在c#中定义一个指向整形数组的指针? 我先是 int[] a 然后打算 int[]* p = a;可程序一直报错,请大虾指教正确的写法。万分感谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 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 int[] a..IntPtr ptr = Marshal.UnsafeAddrOfPinnedArrayElement (a,0); 基础知识普及帖:http://topic.csdn.net/u/20090924/13/235a313c-f906-4fec-bb8f-6555bcc27c58.html c# android socket Udp广播 repeater的itemdatabound问题 c# 文件读写的问题有点难度哦 高手帮忙啊, 急!急!急! asp.net程序放在子目录时出错 C#对WORD操作时页眉处理 winform chart控件 md5算法加密 我感觉现在学习没有人交流学得很慢,所以想交流的人加我QQ? 如何在vc#中怎么知道键入的字符是回车键?急!!在线等! 自定义类如何实现内存释放 初学者的问题一:关闭模态对话框
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
IntPtr ptr = Marshal.UnsafeAddrOfPinnedArrayElement (a,0);