Win Programming Practice (4) [c ++]-multi-dimensional array pointer
// Leleapplication1.cpp: defines the entry point of the console application.
//
# Include "stdafx. h"
# Include
Using std: cout;
Using std: endl;
Using std: cin;
All content of this blog is original, if reproduced please indicate the source http://blog.csdn.net/myhaspl/
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;
}