Creating Custom Data Types with typedef

As we saw in the last two chapters, C allows you to define your own types from enumerations (enums) and structures (structs). C also allows you to redefine types for convenience of naming and to provide clarity about how to use the redefined type. The redefined type becomes a synonym for the original type. Being able to create a synonym of one type from another is extremely useful to express the purpose of variables, not only through their names but also through their redefined types. The benefits of this mechanism are numerous.

The following topics will be covered in this chapter:

  • Creating custom named types from intrinsic types
  • Creating new synonyms from other custom named types
  • Simplifying the use ...

Get Learn C Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.