正在加载图片...
例子:添加运算符重载 #include <string #include <iostream> using namespace std void maino string sl=Hello string S2=world string S3 3=s1 字符串拷贝 cout<<s3<<endl S3=s1+s2 /字符串连接 cout<<s3<<end;例子:添加运算符重载 #include <string> #include <iostream> using namespace std; void main() { string s1="Hello"; string s2="world"; string s3; s3=s1; //字符串拷贝 cout<<s3<<endl; s3=s1+s2; //字符串连接 cout<<s3<<endl; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有