2. Embedded QUEL for C : C Variables and Data Types : Variable and Type Declarations : Type Declarations Syntax
 
Share this page                  
Type Declarations Syntax
The syntax of a type declaration is:
typedef type_specification
        typedef_name {typedef_name};
Syntax Notes:
The typedef keyword acts like a storage class specifier in a variable declaration, except that the resulting typedef_name is marked as a type name and not as a variable name.
The type_specification must be an EQUEL/ C type, a type built up with a typedef declaration and known to the preprocessor, or a structure or union specification. For a discussion of structures, see Structure Declarations Syntax.
Precede the typedef_name by an asterisk (*), to denote a pointer type, or follow it by a bracketed expression ([expr]), to denote an array type. For a discussion of pointers, see Pointer Declarations Syntax. For a discussion of arrays, see Array Declarations Syntax.
The preprocessor accepts an initial value after typedef_name, although you should avoid putting one there because it would not signify anything. Most C compilers allow an initial value that is ignored after the typedef_name. The initial value is not assigned to any variables declared with that typedef.
## typedef       short      INTEGER2;
## typedef       char      CHAR_BUF[2001], *CHAR_PTR;

## INTEGER2      i2;
## CHAR_BUF      logbuf;
## CHAR_PTR      name_ptr = (char *)0;