c++ std::string::append函数

Posted smallredness

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c++ std::string::append函数相关的知识,希望对你有一定的参考价值。

string& append (const string& str);
string& append (const string& str, size_t subpos, size_t sublen);   
string& append (const char* s);
string& append (const char* s, size_t n);
string& append (size_t n, char c);

/*
std::string stra("helloworld");
std::string str;
str.append(stra);
str.append(stra,0,5);
*/

/*
char pch[15]="helloworld";
std::string str;
str.append(pch);
str.append(pch,5);
*/

/*
std::string str;
str.append(5,'c');
*/

以上是关于c++ std::string::append函数的主要内容,如果未能解决你的问题,请参考以下文章