摘要: 在一些笔试题中,常些要写个字符串实现的类,以下是简单的代码实现。 #include <iostream> #include <string> using namespace std; class Mystring { public: friend ostream &operator<<(ostrea 阅读全文
posted @ 2021-02-18 22:29 田大叔 阅读(50) 评论(0) 推荐(0)
摘要: 一: string作为C++常用的一个类,得熟悉它的一些常用的方法。在使用这个类之前,得加上头文件 #include <string> #include <stdexcept> //标准的异常类的库 二: (1)获取string的元素个数方法,还有访问string中的每个元素的方法 void tes 阅读全文
posted @ 2021-02-18 00:15 田大叔 阅读(420) 评论(0) 推荐(0)