对C++中string类型的总结
<span style="font-family: verdana; font-size: 14px; line-height: 21px;">string类对象的构造简化构造函数原型如下(注意,为了简便,把模板中最后一个默认参数省略了):
<blockquote style=""><div class="codearea linewrap" style="color: black; background-color: white; line-height: 18px; width: 495px; text-align: left; font-size: 12px; font-family: 'Courier New', Consolas, Fixedsys, 'BitStream Vera Sans Mono', courier, monospace, serif; padding: 0px; margin: 0px; border: 1px solid #4f81bd;">1:explicit basic_string();2:string(const char *s);3:string(const char *s, size_type n);4:string(const string& str);5:string(const string& str, size_type pos, size_type n);6:string(size_type n, E c);7:string(const_iterator first, const_iterator last);
页:
[1]