For a more extended example, see page 105 of Kernighan and Ritchie (2nd edition), where they successively develop an array version and various pointer versions of the strcpy() routine.