问题描述
解决方案
解决方案二:
a[第几行*每行多少个+第几列]看我的测试代码unsafevoidTest(){int[,]a=newint[10,10]{{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10},{1,2,3,4,5,6,7,8,9,10}};int[]b=newint[]{1,2,3,4,5,6,7,8,9,10};fixed(int*aPoint=a){for(inti=0;i<10;++i){for(intj=0;j<10;++j){Console.WriteLine(aPoint[i*10+j]);}}}}
解决方案三:
另外,我觉得你这个应该不需要使用指针。
时间: 2024-12-01 01:42:18