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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.