Your observations on the K&R code are correct. However, it's a bit more subtle than it appears, which is why your code is not working as you expect.

The first thing to know is that C is a pass by...