a 是字符串,需要用 %s 进行格式化,或者用下面的方法:
a
%s
for (size_t i = 0; i < 2; i++) { printf("%c", a[i]); }
输出的是%c字符类型,用%p输出地址。
printf("%p\n",a);
printf("%s\n",a);