C言語で配列をダンプしたい
from
C言語逆引きメモ
C言語のマクロを書く
code:c
#include
<stdio.h>
#define
DUMP_ARRAY(vec, n) \
do { \
for (int tmp_i = 0; tmp_i < (n); ++tmp_i) { \
printf("%02d", vec
tmp_i
); \
if (tmp_i+1 != n) \
putchar(' '); \
else \
putchar('\n'); \
} \
} while (0)