4 ms·
Yes. EOF is 0, so it will grab all the characters as digits, for the length of the file up until an EOF.
by fao_ 10y ago
Yes. EOF is 0, so it will grab all the characters as digits, for the length of the file up until an EOF.
- dghf 10y agoThe value of EOF is platform-specific, but is commonly -1. I'm fairly sure it's never 0. But I was referring more to the fact that c is set exactly once in line 4 (`int c = getc(fd)`), outside of the nested loops, and never touched again. So if it's not initially a NULL, newline or CR, it never will be, and the inner loop will never exit.