2. Embedded QUEL for C : C Variables and Data Types : Variable and Type Declarations : The Integer Data Type
 
Share this page                  
The Integer Data Type
The EQUEL preprocessor accepts all C integer data types. Even though some integer types do have C restrictions (for example, values of type short must be in the limits of your machine). The preprocessor does not check these restrictions. At runtime, data type conversion is determined according to standard C numeric conversion rules. For details on numeric type conversion, see Data Type Conversion.
The type adjectives long, short, or unsigned can qualify the integer type.
In the type mappings table just presented, the C data type char has three possible interpretations, one of which is the Ingres integer data type. The adjective unsigned can qualify the char type when it is used as a single-byte integer. If a variable of the char data type is declared without any C indirection, such as an array subscript or a pointer operator (the asterisk), it is considered a single-byte integer variable. For example:
##  char        age;
is a legal declaration and can be used to hold an integer Ingres value. If the variable is declared with indirection, it is considered an Ingres character string.
You can use an integer variable with any numeric-valued object to assign or receive numeric data. For example, you can use it to set a field in a form or to select a column from a database table. It can also specify simple numeric objects, such as table field row numbers.
The following example shows the way several C data types are interpreted by EQUEL:
## char  age;               /* Single-byte  integer  */
## short empnums[MAXNUMS];  /* Short  integers  array*/
## long  *global_index;     /* Pointer  to  long  integer  */
## unsigned  int    overtime;