K&R C Chapter 5 Exercise Solutions — Pointers and Arrays

Chapter 5: Pointers and Arrays is the chapter C beginners fear most — and with reason. K&R covers pointer arithmetic, the equivalence between pointers and arrays, pointers to functions, and multi-dimensional arrays. The exercises build real utilities: getfloat, strncpy/strncat/strncmp from scratch, a tail command, a sort program with -r/-n/-f/-d flags, and a full C declaration …