我的代码有问题。我想在第一个位置弹出一个char'_'到一个完整的数组。我写了这个,但终端给我看了一个Abort陷阱:6。你能帮助我吗?
//this code was deleted cause i had good answer! Sorry but is a school project and i couldn't post anything !
我不知道知道我使用mac OSX很重要
您正在使用strcat
函数错误。第一个参数是目标,因为您传递的是字符串文字,所以它是未定义的行为。
strcpy(dupstr, "_");
strcat(dupstr, temp);
应该做的伎俩。