DNWA/11/wywolania/Data/stide_v1.1/Utils/cstrings.h

17 lines
416 B
C
Raw Normal View History

2021-01-28 18:33:55 +01:00
/*
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;
};