Some code for context:
class WordTable
{
public:
WordTable();
~WordTable();
List* GetListByAlphaKey(char key);
void AddListByKey(char key);
bool ListExists(char key);
bool WordExists(string word);
void AddWord(string word);
void IncrementWordOccurances(string word);
void Print();
private:
List *_listArray[33];
int _GetIndexByKey(char key);
};
class TableBuilder
{
public:
TableBuilder();
~TableBuilder();
void AnalyzeStream(fstream &inputStream);
void PrintResults();
private:
void _AnalyzeCursor(string data);
bool _WordIsValid(string data);
WordTable* _WordTable;
};
struct Element {
public:
string Word;
int Occurances;
Element* Next;
};
class List
{
public:
List();
~List();
Element* AddElement(string word);
void DeleteElement(Element* element);
void Print();
void Delete();
Element* First;
bool WordExists(string word);
void IncrementWordOccurances(string word);
private:
void _PrintElementDetails(Element* element);
};
Requirements
I must analyze text, building array of linked lists (where array contains list for each letter; list contains every word found in text), then print out results.
Problem I can`t initialize array of lists in WordTable.cpp. I know that i've misunderstood something, but i got no ideas and time. Anyone?
P.s. Yeah, that's a homework. STOP giving me advices about best practices, please... :)