next up previous contents
Next: A Link Field Up: Practical Use of Pointers Previous: Practical Use of Pointers   Contents

A Linked List

Let's say you need to write a program that has to process many student records in memory. Furthermore, let's say you don't even know what the maximum number of students is.

This is a bit of a problem because no matter how large of an array of student records you allocate, it may not be big enough. Besides, preallocating a large array of student records is wasteful and leaves little resource to the rest of the system.

As a result, this is one of the many applications of dynamic memory allocation. We are not changing the size of an array of student records. Instead, we allocate one student record at a time.



Subsections

Tak Auyeung 2003-12-03