Example code from [K&R][chapter 1.6], simple character counter.