C Programming
By Guy Lecky-ThompsonLesson 6: User Defined Data
Exercise for the Student
Imagine creating an address book application. How would you integrate the oAddressBook structure, and memory management to provide code to add or delete records?
Clue : using the sizeof function to establish how much memory has been allocated, and the nEntries variable, it is possible to effectively allocate and reallocate memory as required.
Further exercise – how would you add file handling, and a menu system? For this you will need to revise the decision making processes in C, as well as the lesson about input and output.