输出二维数组任一行任一列元素的值

 1 #include <iostream>
 2 
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std;
 5 int main(int argc, char** argv) {
 6     int a[3][4]={1,2,3,7,4,32,34,55,66,22,43,12};
 7     int (*p)[4],i,j;
 8     cin >>i>>j;
 9     p=a;
10     cout<<*(*(p+i)+j)<<endl;
11     return 0;
12 }

 

posted @ 2018-08-01 15:26  borter  阅读(331)  评论(0编辑  收藏  举报