#include<iostream>
#include<string>
using namespace std;
void test() {
string str1 = "I ";
const char* s = "wxd, hello!";
str1 += s;
cout << str1 << endl;
string str2;
str2+= str1;
cout << str2 << endl;
str2 += 'a';
cout << str2 << endl;
str2.append(s);
cout << str2 << endl;
str2.append(s, 3);
cout << str2 << endl;
str2.append(str1);
cout << str2 << endl;
str2.append(str1, 4, 6);
cout << str2 << endl;
}
int main() {
test();
return 0;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)