2014年7月28日

C++ String类字符串操作

摘要: string类的构造函数:string(const char *s); //用c字符串s初始化string(int n,char c); //用n个字符c初始化此外,string类还支持默认构造函数和复制构造函数,如string s1;string s2="hello";都是正确的写法。当构造的st... 阅读全文

posted @ 2014-07-28 09:18 月未央 阅读(772) 评论(0) 推荐(0)

c++ string的size()函数和length()函数

摘要: C++标准库中的string中两者的源代码如下: size_type __CLR_OR_THIS_CALL length() const { // return length of sequence return (_Mysize); } size_type __... 阅读全文

posted @ 2014-07-28 09:13 月未央 阅读(2600) 评论(0) 推荐(0)

导航