#include<iostream>
using namespace::std;
int main(){
int ia[3][4]={1,2,3,4,5,6,7,8,9,10,11,12};
int (*p)[4];
for(p=ia;p!=ia+3;++p){
for(int*q=*p;q!=*p+4;++q){
cout<<*q<<" ";
}
}
cout<<endl;
int (*p2)[4];
for(p2=begin(ia);p2!=end(ia);++p2){
for(int *q=begin(*p2);q!=end(*p2);++q){
cout<<*q<<" ";
}
}
cout<<endl;
for(size_t i=0;i!=3;++i){
for(size_t j=0;j!=4;++j){
cout<<ia[i][j]<<" ";
}
}
cout<<endl;
using int_array = int[4];
for(int_array *p =ia;p!=ia+3;++p){
for(int *q = *p;q!=*p+4;q++){
cout<<*q<<" ";
}
}
cout<<endl;
for(auto p = ia;p!=ia+3;++p){
for(auto q=*p;q!=*p+4;++q){
cout<<*q<<" ";
}
}
return 0;
}
网友评论