In this chapter, we will explain the following:
- What a structure is
- How to declare a structure
- How to use typedef to work with structures more conveniently
- How to work with an array of structures
- How to search an array of structures
- How to sort an array of structures
- How to declare nested structures
- How to use structures to manipulate fractions
- How to use structures to solve a “voting” problem
- How structures can be passed to a function
2.1 Defining Structures
In C, a structure is a collection of one or more variables, possibly of different types, grouped together under a single name for convenient handling.
There are many ...