HPlogo HP C/HP-UX Reference Manual: Version A.05.55.02 > Chapter 3 Data Types and Declarations

Type Specifiers

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

Type specifiers indicate the format of the storage associated with a given data object or the return type of a function.

Syntax

   type-specifier ::=
      char
      short
      int
      long
      long long
      unsigned
      signed
      float
      double
      void
      _Bool
      _Complex
      _Imaginary
      struct-or-union-specifier
      enum-specifier
      typedef-name

Description

Most of the type specifiers are single keywords. (Refer to Chapter 10 “HP C/HP-UX Implementation Topics ” for sizes of types.) The syntax of the type specifiers permits more types than are actually allowed in the C language. The various combinations of type specifiers that are allowed are shown in Table 3-1 “C Type Specifiers ”. Type specifiers that are equivalent appear together in a box. For example, specifying unsigned is equivalent to unsigned int. Type specifiers may appear in any order, possibly intermixed with other declaration specifiers.

Table 3-1 C Type Specifiers

void

char

signed char

unsigned char

short, signed short, short int, or signed short int

unsigned short, or unsigned short int

int, signed, signed int, or no type specifiers

unsigned, or unsigned int

long, signed long, long int, or signed long int

long long, signed long long, long long int, or signed long long int

unsigned long, or unsigned long int

unsigned long long, or unsigned long long int

float

double

long double

_Bool

float_Complex

double_Complex

long double_Complex

float_Imaginary

double_Imaginary

long double_Imaginary

struct-or-union specifier

enum-specifier

typedef-name

 

If no type specifier is provided in a declaration, the default type is int.

Floating-point types in C are float (32 bits), double (64 bits), and long double (128 bits).

© Hewlett-Packard Development Company, L.P.