27. How Do I Store Lots of Data?
With Structures
Arrays and pointers are nice for lists of values, but those values must all be of the same data type. There will be times when you have different data types that must go together and be treated as a whole.
A perfect example is a customer record. For each customer, you would have to track a name (character array), balance (double floating-point), address (character array), city (character array), state (character array), and zip code (character array or long integer). Although you would want to be able to initialize ...
Get Absolute Beginner’s Guide to C, 2nd Edition 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.