PreviousNext

Constant Declarations

The IDL constant_declaration can take either of the following forms:

const integer_type_spec identifier = integer | value | integer_const_expression;
const boolean
identifier = TRUE | FALSE | value;
const char
identifier = character | value;
const char*
identifier = string | value;
const void*
identifier = NULL | value;

The integer_type_spec is the data type of the integer constant you are declaring. The identifier is the name of the constant. The integer, integer_const_expression, character, string, or value specifies the value to be assigned to the constant. A value can be any previously defined constant.

IDL provides only integer, Boolean, character, string, and null pointer constants.

Following are examples of constant declarations:

const short TEN = 10;

const boolean FAUX = FALSE;

const char* DSCH = "Dmitri Shostakovich";

More:

Integer Constants

Boolean Constants

Character Constants

String Constants

NULL Constants