写一函数,将两个字符串连接

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了写一函数,将两个字符串连接相关的知识,希望对你有一定的参考价值。

题目描述

写一函数,将两个字符串连接

输入

两行字符串

输出

链接后的字符串

样例输入

123
abc

样例输出

123abc







#include <iostream>
#include <string.h>
using namespace std;
int main()
{
 char a1[1000],a2[1000];
 gets(a1);
 gets(a2);
 cout<<strcat(a1,a2);
 return 0;
}

以上是关于写一函数,将两个字符串连接的主要内容,如果未能解决你的问题,请参考以下文章