C - How to use while feof loop to solve empty input file problem?

140 Views Asked by At

This is an assignment and my professor only allows us to use feof function to read a file input line by line. Now i have an empty file and I got stuck in an infinite loop.

...
while(!feof(stdin)){
    ...
    char inputLineArray[1000];
    scanf("%[^\n]%*c", inputLineArray);
    ...
}
...
0

There are 0 best solutions below