Greetings chound,
C provides
typedef, a facility for creating new data type names. It makes your name a synonym of the defined data-type:
The type Number can be used in declarations and casts in exactly the same ways that the defined type
int can be:
Number i, cars;
Number *blocks[];
Using a synonym for "
char *" is similarily declared. Example:
typedef char *Str;
Str s, a[5], *p;
The type being declared in a
typedef appears in the position of a variable name, not after the word
typedef. The typdef sytax is like the storage classes
extern,
static, and many others. The typedef declaration does not create a new data-type of any sense. It's simply stated as it adds a new name for some existing type.
typedef is similar to
#define, expect that it is interpreted by the compiler. There aren't any new semantics. Variables declared this way have exactly the same properties as variables whose declarations are spelled out explicitly.
Hope this helps,
-
Stack
Overflow