打印数组:
#define ARRAY_SIZE_2(x) (sizeof(x)/sizeof((x)[0]))
int zzzzz[] = {1,2,3,4,45};
for (int i = 0; i < ARRAY_SIZE_2(zzzzz); i++) {
printf("%2d",zzzzz[i]);
}
输出结果:
1 2 3 445
打印数组:
#define ARRAY_SIZE_2(x) (sizeof(x)/sizeof((x)[0]))
int zzzzz[] = {1,2,3,4,45};
for (int i = 0; i < ARRAY_SIZE_2(zzzzz); i++) {
printf("%2d",zzzzz[i]);
}
输出结果:
1 2 3 445
本文标题:c语言小记
本文链接:https://www.haomeiwen.com/subject/eijkgctx.html
网友评论