标签:const ++ scan ons length result please str1 int
#include <stdio.h> char * strcat(char *strDest,const char * strSrc) { char *r=strDest; char *p=strDest; while(*p++ != ‘\0‘); p--; while(*strSrc != ‘\0‘) { *p++ = *strSrc++; } *p = ‘\0‘; return r; } int main() { char str1[100] = {‘\0‘}; char str2[100] = {‘\0‘}; char * ret = NULL; puts("please intput two string to strcat,the two string length max = 99"); puts("eg: abcdef ABCDEF"); scanf("%s%s",str1,str2); printf("\n"); ret = strcat(str1,str2); printf("result: %s\n",ret); return 0; }
标签:const ++ scan ons length result please str1 int
原文地址:https://www.cnblogs.com/liushuhe1990/p/9609109.html