C++中连接两个字符串的算法
来源:百度知道 编辑:UC知道 时间:2024/05/18 03:52:02
你既然用c++那么就用string标准库,很方便就像1楼的
string s1;
string s2;
string s = s1 + s2;
不过要#include <string>
这样就可以了:
string s1;
string s2;
string s = s1 + s2;
strcat(str1,str2);
不过前面要加个#include<string.h>的头文件
strcat(str1,str2)