2011年3月11日

C++ string类常用函数

摘要: 【转】C++ string类常用函数http://xiaocao000.spaces.live.com/blog/cns!F826A925CF33491A!117.entrystring类的构造函数:string(const char *s); //用c字符串s初始化string(int n,char c); //用n个字符c初始化此外,string类还支持默认构造函数和复制构造函数,如string s1;string s2="hello";都是正确的写法。当构造的string太长而无法表达时会抛出length_error异常 string类的字符操作:const char 阅读全文

posted @ 2011-03-11 16:42 Livid 阅读(248) 评论(0) 推荐(0) 编辑

导航