You are forgetting to pass a FILE
(stream pointer) as a parameter of the fscanf
function:
while (fscanf(ifp, "%c", &words) != EOF)
According to the man, the signature of fscanf
is:
int fscanf(FILE *restrict stream, const char *restrict format, ...);