标签:hello har amp sign size_t size sub pre ble
string& assign (const string& str);
string& assign (const string& str, size_t subpos, size_t sublen);
string& assign (const char* s);
string& assign (const char* s, size_t n);
string& assign (size_t n, char c);
/*
std::string stra("helloworld");
std::string str;
str.assign(stra);
str.assign(stra,0,5);
*/
/*
char pch[15]="helloworld";
std::string str;
str.assign(pch);
str.assign(pch,5);
*/
/*
std::string str;
str.assign(5,'c');
*/
标签:hello har amp sign size_t size sub pre ble
原文地址:https://www.cnblogs.com/smallredness/p/11058922.html