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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.