I\'m currently working through the excercises in \'The C Programming Language\'. Here\'s one of my solutions:
int c; while ((c=getchar()) != EOF) { if (c == \
I've used code like this. I don't think there's really any reason not to use it if the situation warrants it.