std::string构造函数

string();
string (const string& str);
string (const string& str, size_t pos, size_t len = npos);
string (const char* s);
string (const char* s, size_t n);
string (size_t n, char c);

/*
std::string str();
*/

/*
std::string stra("hello");
std::string str(stra);
std::string str(stra,0,2);
*/

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

/*
std::string str(5,'c');
*/
原文地址:https://www.cnblogs.com/smallredness/p/11058830.html