Exercise 02 - Pointers / Arrays / Strings

Out: Wednesday January 17, 2018
Due: Friday January 19, 2018 by 11:59pm.
Note the unusual due time.

  1. We provide a mainline (ex3.c) and a makefile. The mainline is bug free and the makefile works, in that it would build a bug-free executable if files Person.h and Person.c were available.

  2. Provide suitable Person.h and Person.c files. You can deduce what must be in them by looking at ex3.c.

  3. (We also provide a solution executable, ex3. Download and restore its executable permissions (chmod u+x ex3) to run it.)

Hand in to the course dropbox:
  • Your Person.c and Person.h files. (We will supply our ex3.c and makefile when we try to build your code.)
(The following are generic requirements that will appear every exercise. Exactly how pertient they are can vary from one exercise to another.)

Your code must:

  • compile on attu without errors or warnings

  • have no crashes, memory leaks, or memory errors

  • be pretty: the code and its formatting, modularization, variable and function names, and so on, must make us smile rather than cry.

  • be robust: you should think about handling bogus input from the user, and you should handle hard-to-handle cases (if there are any) gracefully.