/*
烟台大学计算机与控制工程学院
All rights reserved.
作者:汪莹莉
完成时间:2016年12月09日
题目描述
写一函数,将两个字符串连接
输入
两行字符串
输出
链接后的字符串
样例输入
123
abc
样例输出
123abc
编译的程序:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char str1[20], str2[20];
gets(str1);
gets(str2);
strcat(str1,str2);
puts(str1);
return 0;
}
运行结果:
知识点总结:strcat{str1,str2)为将字符串str2连接到str1后面,输出时直接puts(str1)
学习心得:程序中含有str则需要补写#include <string.h>