17 lines
416 B
C++
Executable File
17 lines
416 B
C++
Executable File
/*
|
|
This class implements strings. It is meant to offer all the functionality
|
|
of strings in C, so whenever a C function is needed that manipulates strings,
|
|
it must be coded into this.
|
|
*/
|
|
|
|
class String {
|
|
public:
|
|
String(void) {data = NULL; dsize = 0;}
|
|
String(char *init) {dsize = strlen(init); data = new char[dsize];}
|
|
~String(void) {if (dsize) delete data;}
|
|
|
|
private:
|
|
char *data;
|
|
int dsize;
|
|
};
|