#include #include #include #include "slist.h" StringList::StringList() { count = 0; max = 10; maxc = 0; data = (char **)malloc(10*sizeof(char *)); } StringList::~StringList() { int i; for (i=0; i count) { int cc, mc; for (cc=0, mc=0; mc= count || i < 0) return 0; return data[i]; } void StringList::add(char *s) { if (has(s)) return; if (maxc >= max) { max += 10; data = (char **)realloc(data, max * sizeof(char *)); } data[maxc] = (char *)malloc(strlen(s)+1); strcpy(data[maxc], s); count++; maxc++; } void StringList::del(char *s) { int i; for (i=0; i