原文:编写一程序,将两个字符串连接起来的3种方法

.用字符数组和自己书写的函数实现 自己写一个具有strcat函数功能的函数 实现代码如下: include lt iostream gt using namespace std int main char a ,b void Strcat char a ,char b cout lt lt please input first string: lt lt endl cin gt gt a cou ...

2013-07-20 23:09 0 10163 推荐指数:

查看详情

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

一程序,将两个字符串连接起来,不要用strcat函数 【答案解析】 直接将s2中的字符逐个拷贝到s1的末尾即可,用户需要保证s1中能存的下s2中的字符 获取s1末尾的位置 将s2中的字符逐个拷贝到s1中 【代码实现】 【结果截屏】 ...

Mon Sep 14 23:20:00 CST 2020 0 1766
一程序,将两个字符串连接起来,不要用strcat函数

一程序,将两个字符串连接起来,不要用strcat函数 【答案解析】 直接将s2中的字符逐个拷贝到s1的末尾即可,用户需要保证s1中能存的下s2中的字符 获取s1末尾的位置 将s2中的字符逐个拷贝到s1中 【代码实现】 【结果截屏】 ...

Sat Jul 18 00:16:00 CST 2020 0 2531
实现两个字符串连接

!= '\0') { str1++; //让指针指向字符串的尾部 } while (*str2 != '\0') { *st ...

Thu May 31 02:13:00 CST 2018 0 1000
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM