Scanning white-space characters
int c = getc(f);
int nl = 0;
while (isspace(c)) {
if (c == `\n')
++nl;
c = getc(f);
}
This type must be int,
not char, so that we can
hold any character and
still have room for EOF
Previous slide
Next slide
Back to first slide
View graphic version