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

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

最佳回答

坚定的机器猫

魔幻的纸鹤

2026-03-29 17:34:20

#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-03-29 17:34:20

    #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