为什么数组name中的元素只有一个,赋值一个A给数组name后还会随机输出
#include<stdio.h>
int main(void)
{
double cash = 123.4;
char name[1];
name[0] = 'A';
printf("The %s family just may be $%+5.2f dollars richer!\n", name, cash);
return 0;
}
结果
The A烫*17(发不了)贴-!瘗 family just may be $+123.40 dollars richer!
D:\C Primer Plus 程序作业\P75-2\x64\Debug\P75-2.exe (进程 25024)已退出,代码为 0。
按任意键关闭此窗口. . .