5124| 1
|
怎么用C语言实现在二维数组里循环遍历呢? |
20金钱
最佳答案[mw_shl_code=c,true]unsigned char data[2][2] = {1, 1, 2, 2};
unsigned int i = 0, j = 0;
for (i = 0; i < sizeof(data) / sizeof(data[0]); i++)
{
for (j = 0; j < sizeof(data[0]); j++)
{
printf("data[%d][%d] = %d\r\n", i, j, data[j]);
}
}[/mw_shl_code]
| ||
发表于 2018-1-12 15:15:16
|
显示全部楼层
| ||
|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )
GMT+8, 2024-11-25 23:23
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网