字符串中的函数

#include<bits/stdc++.h>
using namespace std;
char a[100010];
char b[100010];
int main()
{
cin>>a;
cin>>b;
number1:strcat(a,b);    连接字符串 a,b 并把 连接后的值 赋给a;
number2:cout<<strcmp(a,b)<<endl;   不开for循环的话只取首位,并且 : 若a==b则返回0,若a>b则返回1,若a<b则返回-1;

即:两个字符串自左向右逐个字符相比(按ASCII值大小相比较),直到出现不同的字符或遇''为止。
number3:strcpy(a,b);    将 字符串b的值 代替  a原串中的值,使得 字符串 a==b; 
cout<<a<<endl; 
}
原文地址:https://www.cnblogs.com/nlyzl/p/11267905.html