strcat(a,b),将a和b连接在一起。
strcmp(a,b),字符串比较函数。
#include<iostream>
#include<string>
using namespace std;
int main(){
char *str1 = "cd", *str2 = "abc";
int res = strcmp(str1, str2);
if (res > 0){
printf("%s is great than %s\n", str1, str2);
}
else if (res == 0){
printf("%s is same as %s\n", str1, str2);
}
else{
printf("%s is less than %s\n", str1, str2);
}
return 0;
}