Lugaru's Epsilon
Programmer's
Editor

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

Previous   Up    Next
Structures and Unions  Epsilon Extension Language   Typedefs


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

Complex Declarators

As some of the examples thus far have shown, you can compose (combine) declarators to yield arbitrarily complicated types, like function returning pointer to an array of 10 chars:

char (*foo())[10];

When composing declarators, function and array declarators have the same precedence. They each take precedence over pointer declarators. So the example we used in Function Declarators:

char *(fpc());

could have been written more simply as

char *fpc();.

The rule that EEL follows for declarations is that the identifier involved is to be declared so that an expression with the form of the declarator has the type of the type specifier. This implies that the grouping of operators in a declarator follows the same rules as the operators do in an expression.

There are a few restrictions on the combinations of declarators when functions are involved (and so on the combinations of types). Functions may not return arrays, structures, unions, or functions, but they may return pointers to any of these. Similarly, functions may not be members of structures, unions, or arrays, but pointers to functions may be.



Previous   Up    Next
Structures and Unions  Epsilon Extension Language   Typedefs


Lugaru Copyright (C) 1984, 2012 Lugaru Software Ltd. All Rights Reserved.