-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.h
More file actions
36 lines (29 loc) · 782 Bytes
/
Copy pathstring.h
File metadata and controls
36 lines (29 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef STRING
#define STRING
#include <iostream>
using std::ostream;
using std::istream;
class String {
private:
char *str;
int len;
static int num_strings;
static const int CINLIM = 80;
public:
String();
String(const char *s);
String(const String &s);
~String();
int length() const {return len;}
String & operator=(const String &s);
String & operator=(const char *s);
char & operator[](int i);
const char & operator[](int i) const;
friend bool operator<(const String &s1, const String &s2);
friend bool operator>(const String &s1, const String &s2);
friend bool operator==(const String &s1, const String &s2);
friend ostream & operator<<(ostream &os, const String &s);
friend istream & operator>>(istream &is, String &s);
static int HowMany();
};
#endif