【发布时间】:2017-12-19 03:37:32
【问题描述】:
我只是在做一些练习代码,但我无法弄清楚这个顽固的线程 1:
信号 SIGABRT 错误。
int main(){
char diet[] = "vegan";
printf("Because of health concerns, my diet is now %s.\n", diet);
strcpy(diet, "whatever");
printf("Before the health concerns, my diet was %s.\n", diet);
return 0;
}
【问题讨论】:
-
您正在尝试使用
strcpy将 9 个字符(包括空终止符)复制到只能容纳 6 个字符的空间中。
标签: c xcode multithreading