字符串
C++中有string类型,可以有拷贝(=),字符串连接(+=,+),字符串比较(== 、!=、>、.....操作)。
#include<iostream>
using namespace std;
int main(void){
string s;
s = "hello";
cout<<s<<endl;
string s1 = "world";
s1 = s + " " + s1;
cout<<s1<<endl;
string s2 = "hello";
cout<<(s1==s2)<<endl;
cout<<(s1!=s2)<<endl;
cout<<s1.size()<<endl;
return 0;
}