I wrote the following subclass for my main program:
#define READFILE "r"
#define WRITEFILE "w"
#define WORDARRAYSIZE 16
#define MAXIMUMWORDCHARACTERS 15
void CreateWordList (char inputFileName [ ])
inputFile = fopen (inputFileName, WRITEFILE);
if (inputFile == NULL)
fprintf(stderr, "Error - Cannot open %s for reading!\n",
int CountNumberOfWords (FILE* inputFile)
int wordCounter = 0;
char wordArray [WORDARRAYSIZE];
while (fgets (wordArray, WORDARRAYSIZE, inputFile) != NULL )
Basically, I'm just trying to count the number of words in a data file, where you have no idea how many words are actually there. The first function has not been completed and is completely useless in its remedial stages, but somewhere, the following error occurs, “Undefined reference to main c++”