2021-09-29 《C++primer》3.6节练习 关于范围for循环处理多维数组
在做3.43练习时,使用范围for循环遍历二维数组的元素,代码如下:
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int ia[3][4]={0,1,2,3,4,5,6,7,8,9,10,11};
for(int *row : ia){
//cout<<row[0]<<endl;
for(int col : row){
原创
2021-09-29 15:07:39 ·
593 阅读 ·
1 评论