Mail Archives: djgpp/1997/11/18/23:07:02
I am learning how to program in C and I have the following problem:
I wrote a simple While-loop that scans in some strings until the EOF
marker is reached (or Cntrl-D is pressed). The loop works correctly
when compiled on a Unix compiler but refuses to do so when compiled with
DJGPP. According to my text book, the scanf function returns EOF when
it reaches the end of the line or an error occurs. That seems to me to
be the problem.... I am not sure though.. and would appreciate some help
ASAP because this project is due next week...
Thank You,
Elvis Dieguez
PS I read the FAQ but I did not find anything to help me....
PPS Here is the loop:
while( scanf("%s", array[i]) != EOF){
++i;
}
- Raw text -