DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
C language compilers

Basic types

The basic types and their sizes are:

Integral and floating types are collectively referred to as ``arithmetic types''. Arithmetic types and pointer types make up the ``scalar types''.


NOTE: See ``Pointer declarators'' for more information.

Type qualifiers

Structures and unions

Enumerations

An enumeration is a unique type that consists of a set of constants called enumerators. The enumerators are declared as constants of type int, and optionally may be initialized by an integral constant expression separated from the identifier by an = character.

Enumerations consist of two parts:

For example:
   enum color {red, blue=5, yellow};
color is the tag for this enumeration type. red, blue, and yellow are its enumeration constants. If the first enumeration constant in the set is not followed by an =, its value is 0. Each subsequent enumeration constant not followed by an = is determined by adding 1 to the value of the previous enumeration constant. Thus yellow has the value 6.
   enum color car_color;
declares car_color to be an object of type enum color.
Next topic: Scope
Previous topic: Declarations and definitions

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004