c++ std::string的assign函数
2020-12-13 02:52
标签:hello har amp sign size_t size sub pre ble c++ std::string的assign函数 标签:hello har amp sign size_t size sub pre ble 原文地址:https://www.cnblogs.com/smallredness/p/11058922.htmlstring& 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');
*/
上一篇:JFace dailog button事件中刷新透视图异常 Trying to execute the disabled command org.eclipse.ui.window.closePers
下一篇:排序之归并排序