Chapter 9

Designing Your OwnData Structures

Chapter 8 introduced several new data types, such as float, char, and short. We discussed the range of each type and the format specification characters necessary to print each type using printf(). Next, I introduced the concept of arrays, focusing on the relationship between char arrays and text strings. Along the way, you discovered the #define statement, C's text substitution mechanism.

This chapter will show you how to use existing C types as building blocks to design your own customized data structures.

Bundling Your Data

There will be times when your programs will want to bundle certain data together. For example, suppose you were writing a program to organize your DVD collection. Imagine the ...

Get Learn C on the Mac now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.