str.h

来自「c++书籍的源代码」· C头文件 代码 · 共 19 行

H
19
字号
//str.h
#ifndef STR_H
#define STR_H
 class str
{
 public:
  str(char *p="");
  str(str&);
  ~str();
  str& operator =(str s1);
  str operator +(str& s1);
  int operator ==(str& s1);
  char operator [](int i);
  friend ostream& operator <<(ostream&,const str&);
 private:
  char *s;
  int len;
};
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?