4.1 Declaration Syntax Rules

The general syntax of a declaration is as follows:

declaration:

   declaration-specifiers init-declarator-list(opt);

declaration-specifiers:

   storage-class-specifier declaration-specifiers(opt)
   type-specifier declaration-specifiers(opt)
   type-qualifier declaration-specifiers(opt)

init-declarator-list:

   init-declarator
   init_declarator-list , init-declarator

init-declarator:

   declarator
   declarator = initializer

Note the following items about the general syntax of a declaration:

Consider the following example:

volatile static int data = 10;

This declaration shows a qualified type (a data type with a type qualifier-in this case, int qualified by volatile ), a storage class (static ), a declarator (data ), and an initializer (10 ). This declaration is also a definition, because storage is reserved for the data object data .

The previous example is simple to interpret, but complex declarations are more difficult. See your platform-specific DEC C documentation for more information about interpreting C declarations.

The following semantic rules apply to declarations:

Storage Allocation

Storage is allocated to a data object in the following circumstances:


Previous Page | Next Page | Table of Contents | Index