C Programming

By Guy Lecky-Thompson

Lesson 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.

Print this Page Print this page


Previous Page  1  2  3  4  5 


Lessons

Lesson 1: Introduction to Programming
Lesson 2: Introduction to C
Lesson 3: Decision Making in C
Lesson 4: Repetition in C
Lesson 5: I/O & Data Types
Lesson 6: User Defined Data
• Exercise for the Student
Lesson 7: Functions
Lesson 8: Common Standard Libraries