cpp/language/typedef


 * - creates an alias that can be used anywhere in place of a (possibly complex) type name.

Explanation
The specifier, when used in a, specifies that the declaration is a typedef declaration rather than a variable or function declaration. Typically, the specifier appears at the start of the declaration, though it is permitted to appear after the type specifiers, or between two type specifiers.

A typedef declaration may declare one or many identifiers on the same line (e.g. int and a pointer to int), it may declare array and function types, pointers and references, class types, etc. Every identifier introduced in this declaration becomes a typedef-name, which is a synonym for the type of the object or function that it would become if the keyword were removed.

The specifier cannot be combined with any other specifier except for s.

The typedef-names are aliases for existing types, and are not declarations of new types. Typedef cannot be used to change the meaning of an existing type name (including a typedef-name). Once declared, a typedef-name may only be redeclared to refer to the same type again. Typedef names are only in effect in the scope where they are visible: different functions or class declarations may define identically-named types with different meaning.

The specifier may not appear in the declaration of a function parameter nor in the  of a :

The specifier may not appear in a declaration that does not contain a declarator:

typedef-name for linkage purposes
Formally, if the typedef declaration defines an unnamed or, the first typedef-name declared by the declaration to be that class type or enum type is used to denote the class type or enum type for linkage purposes only. For example, in, is a typedef-name for linkage purposes. The class or enum type defined in this way has (unless it's in an unnamed namespace).