1. 程式人生 > >輸出二維數組任一行任一列元素的值

輸出二維數組任一行任一列元素的值

con loop ret pro NPU get div cin etc

 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 }

輸出二維數組任一行任一列元素的值