K
Kris
Hi!
I'm wondering why EOF is used in this lines of code (I know this program
won't do very much useful...). Is it a way to say "I want this loop to run
forever", a way to pick up errors, or maybe you can get the EOF value (-1)
from the keyboard to terminate the program?
int c;
while((c = getchar()) != EOF) {
;
}
Kris
I'm wondering why EOF is used in this lines of code (I know this program
won't do very much useful...). Is it a way to say "I want this loop to run
forever", a way to pick up errors, or maybe you can get the EOF value (-1)
from the keyboard to terminate the program?
int c;
while((c = getchar()) != EOF) {
;
}
Kris