I have instructions to use a pointer of a pointer as an array of pointers and this is what I have:
className **wordArray;
wordArray = new className*[wordCount];
ifstream fileInput;
fileInput.open(fileDir);
while (fileInput >> wordInput)
{
wordArray[countNumber] = new className(wordInput.c_str());
countNumber++;
}
class className
{
public:
className(const char *word);
~className();
};
className::className(const char *word)
{
char wordArray[strlen(word)];
strcpy(wordArray, *word);
}
My problem occurs when it compiles, or tries to. It says that there is an "undefined reference" to the class. The constructor for the class is supposed to take a const char*
and I have tried a few other things to no avail.