实验8-2-7 字符串的连接 (15 分)
作者:互联网
#include <stdio.h> #include <string.h> #define MAXS 10 char *str_cat(char *s, char *t); int main() { char *p; char str1[MAXS + MAXS] = { '\0' }, str2[MAXS] = { '\0' }; scanf("%s%s", str1, str2); p = str_cat(str1, str2); printf("%s\n%s\n", p, str1); system("pause"); return 0; } /* 你的代码将被嵌在这里 */ char *str_cat(char *s, char *t) { strcat(s, t); return s; }
标签:15,MAXS,str1,cat,char,str,str2,字符串,连接 来源: https://www.cnblogs.com/Robert-De-Niro/p/15974416.html