O'Reilly logo

C Programming Absolute Beginner’s Guide, Third Edition by Dean Miller, Greg Perry

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

27. Setting Up Your Data with Structures

Arrays and pointers are nice for lists of values, but those values must all be of the same data type. Sometimes 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 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 and print individual items within the customer record, you would also want to access the customer record as a whole, such as when you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required