//ConsoleApplication1.cpp : 定義控制台應用程序的入口點。
//
#include "stdafx.h"
#include
using std::cout;
using std::endl;
using std::cin;
int main()
{
char temp;
int x[2][4];
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 4; j++) {
x[i][j] = i*10+j;
}
}
int *x1ptr = &x[0][0];
int (*x2ptr)[4] = x;
for (; x2ptr <= &x[1]; x2ptr++) {
for (int j = 0; j < 4; j++) {
cout << (*x2ptr)[j]<< " ";
}
cout << endl;
}
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 4; j++) {
cout << *(*(x+i)+j) << " ";
}
cout << endl;
}
for (int i= 0; i < 2; i++) {
for (int j = 0; j < 4; j++) {
cout << *(x1ptr + i*4+ j) << " ";
}
cout << endl;
}
cin >> temp;
return 0;
}