malloc()技巧,用指针的方式。
C
char *r ,*malloc();
r = malloc(strlen(s)+strlen(t)+1);
//如果调用malloc()失败会反回NULL
if(!r){
complain();
exit(1);
}
strcpy(r,s);
strcat(r,t);
//实现s和t的拼接
//一段时间之后再使用
f...
6-03 2,109PVs
阅读全文 46-03 2,109PVs
阅读全文 411-25 1,518PVs