请问如何在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#实现让电脑睡觉觉! GDI+ 中发生一般性错误” 关于接口的疑惑,接口有什么意义 CLR函数问题 请教C#连接使用MYSQL的详细方法和步骤.解决立刻给分~~ 将listbox绑定后要更改item内容的问题 如何可以遍历一个对像所有的属性? 快来帮帮我!事件触发的问题。 自定义类如何实现内存释放 初学者的问题一:关闭模态对话框
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);