string 类 自定义.docVIP

  • 2
  • 0
  • 约5.21千字
  • 约 9页
  • 2016-12-03 发布于河南
  • 举报
string 类 自定义

自定义 C++ string 类 先来看 str.h 头文件 #pragma once #include iostream class str { public: str(void); str(char*); ~str(void); protected: char* string; //存放字符串 public: int length(void); int findchar(char s); //查找字符返回this.string序号 0,1,2…..length()-1; int findstr(char* str); //查找字符串 返回this.string从0开始 字符串 的位置; char** seg(char* sign, int* out); //以字符串str截断this.string 返回字符串段数量*out 以及字符串段地址 char* copy(int start, int end); //拷贝字符串this.string int findchar(char* str, char c); //str中查找字符串str int findstr(char

文档评论(0)

1亿VIP精品文档

相关文档