搜索
您的当前位置:首页正文

编一程序,将两个字符串连接起来,不要用strcat函数

来源:爱够旅游网
编⼀程序,将两个字符串连接起来,不要⽤strcat函数

#include int main(){

char s1[80],s2[40]; int i=0,j=0;

printf(\"Please input your String1:\\n\"); scanf(\"%s\

printf(\"Please input your String2:\\n\"); scanf(\"%s\ while(s1[i]!='\\0') i++;

while(s2[j]!='\\0') {

s1[i]=s2[j]; j++; i++; }

// s1[i]='\\0';

printf(\"The new string is:%s\\n\ return 0; }

因篇幅问题不能全部显示,请点此查看更多更全内容

Top