输入两个字符串s1和s2,然后将s2接在s1后面,输出连接后的字符串,不可以利用库函数strcat.

学习 时间:2026-05-14 03:11:35 阅读:7772
输入两个字符串s1和s2,然后将s2接在s1后面,输出连接后的字符串,不可以利用库函数strcat.

最佳回答

多情的小笼包

诚心的大神

2026-05-14 03:11:35

#include using namespace std;char * myStrcat(char* destStr,const char* srcStr) //方法一,数组操作{\x09int srcLen = 0;\x09int destLen = 0;\x09while(srcStr[srcLen]!='\0')\x09{\x09\x09srcLen++;\x09}\x09while(destStr[destLen]!='\0')\x09{\x09\x09destLen++;\x09}\x09for(int i = 0 ; i

最新回答共有2条回答

  • 爱笑的钢笔
    回复
    2026-05-14 03:11:35

    #include using namespace std;char * myStrcat(char* destStr,const char* srcStr) //方法一,数组操作{\x09int srcLen = 0;\x09int destLen = 0;\x09while(srcStr[srcLen]!='\0')\x09{\x09\x09srcLen++;\x09}\x09while(destStr[destLen]!='\0')\x09{\x09\x09destLen++;\x09}\x09for(int i = 0 ; i

上一篇 There are some monkey and lion h---at the zoo.They can live

下一篇 you must stay in bed and don't move -------.应填too much ,还是mu