cstring.h
来自「《C/C++程序设计导论(第二版)》一书的程序源文件」· C头文件 代码 · 共 37 行
H
37 行
// CString.h header file for String classs#ifndef _IOSTREAM_H#include <iostream.h>#endifconst char NULLC = '\0';const int MAX = 80;class String { public: String(); // simple constructor String (char []); // literal constructor String operator= (String); // assignment by String operator char* (); // outward cast conversion int Atoi (); // converts text to int float Atof (); // converts text to float int Length (); // returns length of string String Substr (int, int); // substring copy int Contains (String); // position of substring int operator== (String); int operator!= (String); // Strings and literals... int operator<= (String); int operator>= (String); int operator< (String); int operator> (String); String operator+ (String); // concatenation char Onechar (int); // return a single character void Onechar (int, char); // replace a single character void InputStr (istream&); // input function void OutputStr (ostream&); // output function private: char cells[MAX]; };// prototypes for overloaded >> and << I/O operators istream& operator>> (istream& in, String& a); ostream& operator<< (ostream& out, String a);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?