examples from kernighan and ritchie