Typedef

From Tux
Revision as of 13:23, 27 January 2018 by Williams (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

typedef can be used to rename a data type. The last identifier is the renamed type, while everything between typedef and it is what it can be used in place of.

typedef unsigned long int myint;

// The following two variable declarations are equivalent given the above typedef
unsigned long int x;
myint x;

typedef statements can be made global.