HP C A.06.05 Reference Manual

Data Types and Declarations
Type Definitions Using typedef
Chapter 362
Other type specifiers (that is, void, char, short, int, long, long long, signed,
unsigned, float, or double) cannot be used with a name declared by typedef. For example,
the following typedef usage is illegal:
typedef long int li;
.
.
.
unsigned li x;
typedef identifiers occupy the same name space as ordinary identifiers and follow the same
scoping rules.
Structure definitions which are used in typedef declarations can also have structure tags.
These are still necessary to have self-referential structures and mutually referential
structures.
Example
typedef unsigned long ULONG; /* ULONG is an unsigned long */
typedef int (*PFI)(int); /* PFI is a pointer to a function */
/* taking an int and returning an int */
ULONG v1; /* equivalent to "unsigned long v1" */
PFI v2; /* equivalent to "int (*v2)(int)" */