O'Reilly logo

Learn to Program with C by Noel Kalicharan

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

CHAPTER 10

image

Structures

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 store parallel arrays
  • How structures can be passed to a function

10.1 The Need for 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 ...

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