O'Reilly logo

C Programming Essentials by S. K. Bandyopadhyay, K. N. Dey

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 7. User-Defined Data Types

In this chapter, we discuss several new data types that are available in C. These data types are convenient to handle and simplify the programming task.

Structures

Consider that we want to write a program where we need to keep a group of dissimilar data items together. The techniques discussed so far are inapplicable in this regard. Arrays cannot achieve the purpose since an array requires all the items stored in it to be of the same data type. In this situation, we would use C structures to keep the group of dissimilar data items under a single composite variable. Thus, in contrast to arrays, a structure is used to represent a collection of data items, possibly of different data types, by a single name. So, by ...

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