Name

typedef keyword — Declares a type synonym

Synopsis

               decl-specifier := typedef

A typedef declaration creates a synonym for an existing type. It does not create a new type (as class and enum do).

Example

typedef unsigned int UINT;
typedef map<string,string> dictionary;

See Also

class, declaration, enum, struct, typeid, union, Chapter 2

Get C++ In a Nutshell 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.