Hi all, can you please help me solve these errors I am receiving:
q2.cpp:127: error: expected primary-expression before ‘*’ token
q2.cpp:127: error: ‘wordPointer’ was not declared in this scope
print function which is contained within the sc class:
void printDict(struct wordRecord *wordPointer) {
// Code omitted to step through the dictionary words in turn,
// printing each out on a new line
//Step through dictionary, printing each word
wordPointer -> root;
while(wordPointer != NULL) {
printf("%s\n", wordPointer -> word);
wordPointer = wordPointer -> next;
}
}
calling from main function:
caseSensitiveSpellChecker sc;
//caseSensitiveSpellChecker * sc = new caseSensitiveSpellChecker();
for (int i=0; i<sizeof(words)/sizeof(char*); i++) sc->addWord(words[i]);
printf("\nCase sensitive dictionary contents:\n");
[B] sc.printDict(wordRecord *wordPointer);[/B]
The bold line (127) is the call which is giving me the errrors. I have already tried:
sc.printDict();
sc.printDict(struct wordRecord *wordPointer);
sc.printDict(wordRecord *wordPointer);.
and haven't any more ideas on what to do.
Thanks in advance,
Aphrodite