摘要: 若想使用标准库的string类需要使用如下声明:#includeUsingstd::string;Usingstd::wstring;那么就可以使用这两个类了;以string为例子介绍其对外接口:String类的构造函数Strings1; //Strings2(s1);Strings3(“holloworld!”);Strings4(n,‘c’);string对象的操作s.empty()如果s为空串,则返回true,否则返回false。s.size()返回s中字符的个数s[n]返回s中位置为n的字符,位置从0开始计数s1+s2把s1和s2连接成一个新字符串,返回新生成的字符串s1=s2把s1内 阅读全文
posted @ 2014-03-15 21:29 夏大王 阅读(309) 评论(0) 推荐(0) 编辑