Try commenting your code. That would tell you quite a lot, if you comment
exactly.
Based on your code:
if ((input = fopen("infile", "r")) !=NULL) // open the file
{
while ((fileInput = fgetc(input)) != EOF) // read a single character
{
strcpy(input, word); // copy WORD into INPUT
putchar(fileInput); // Output the character read
fillArray(word);
}
You never did anything with the
single character you read. And you never read any more than that.
Isn't INPUT a file designator? Does
strcpy() work on such an item? Look it up. I know your compiler complained about that.
Reputation Points: 3278
Solved Threads: 890
Posting Sage
Offline 7,718 posts
since May 2006