Lugaru's Epsilon
Programmer's
Editor 14.04

Context:
Epsilon User's Manual and Reference
   Epsilon Extension Language
      . . .
      Scope of Variables
      Data Types
         . . .
         Structures and Unions
         Complex Declarators
         Typedefs
         Type Names
      Initialization
      . . .

Previous   Up    Next
Complex Declarators  Epsilon Extension Language   Type Names


Epsilon User's Manual and Reference > Epsilon Extension Language > Data Types >

Typedefs

typedef-definition:
        typedef type-specifier declarator-list ;

You can use typedefs to provide convenient names for complicated types. Once you define it, use a typedef as a type specifier (like int) in any declaration. A typedef definition looks just like a variable definition, except that the keyword typedef appears before the type specifier. The name of the typedef being defined appears instead of the variable name, and the typedef has the same type the variable would have had.

Typedefs only serve as abbreviations. They always create types that could be made in some other way. A variable declared using a typedef is just the same as a variable declared using the full specification. For example:

typedef short *NAME_LIST;
NAME_LIST nl, narray[20];

is equivalent to

short *nl, *narray[20];



Previous   Up    Next
Complex Declarators  Epsilon Extension Language   Type Names


Lugaru Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.