O'Reilly logo

Embedded C Programming by Mark Siegesmund

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 9

Structures

Abstract:

This chapter deals with C structures and unions. Some other languages call these records. Structure definitions are covered along with the use of tags and typedefs. The advanced topics of nested structures and bit fields are fully explained with examples. The differences between unions and structures are taught in this chapter.

The layout of structures and unions in memory is shown, as well as the use of the packed attribute. This chapter has many examples to show how structures can be best used in embedded programs for microcontrollers.

Examples and exercises are for the popular PIC™ microcontroller manufactured by Microchip.

Keywords:

Structure

Struct

Union

Member

Field

Bit field

Tag

Attribute

Packed

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