C/C++ Programmer's Guide (G06.25+)

HP C/C++ Programmer’s Guide for NonStop Systems429301-008
D-1
D Data Type Correspondence
Table D-1, Integer Types, Part 1, on page D-1
Table D-2, Integer Types, Part 2, on page D-3
Table D-3, Floating, Fixed, and Complex Types, on page D-4
Table D-4, Character Types, on page D-5
Table D-5, Structured, Logical, Set, and File Types, on page D-6
Table D-6, Pointer Types, on page D-7
Table D-7, Address Types1, on page D-8
The following tables contain the return value size generated by HP language compilers
for each data type. Use this information when you need to specify values with the
Accelerator ReturnValSize option. These tables are also useful if your programs use
data from files created by programs in another language, or your programs pass
parameters to programs written in callable languages.
Note that the return value sizes given in these tables do not correspond to the storage
size of SQL data types. For a complete list of SQL data type correspondence, see:
SQL/MP Programming Manual for C
SQL/MX Progamming Manual for C and COBOL.
If you are using the Data Definition Language (DDL) utility to describe your files, see
the Data Definition Language (DDL) Reference Manual for more information.
Note. COBOL includes COBOL 74, COBOL85, and SCREEN COBOL unless otherwise noted.
Table D-1. Integer Types, Part 1 (page 1 of 2)
C-series
BASIC
STRING INT
INT(16)
INT(32)
C and C++ char
1
unsigned char
signed char
int in the 16-bit data
model
short
unsigned
int in the 32-bit or wide
data model
long
unsigned long
COBOL Alphabetic
Numeric DISPLAY
Alphanumeric-Edited
Alphanumeric
Numeric-Edited
PIC S9(n) COMP or
PIC 9(n) COMP
without P or V,
1 <
n < 4
Index Data Item
2
NATIVE-2
3
PIC S9(n) COMP or
PIC 9(n) COMP
without P or V,
5 <
n < 9
Index Data Item
2
NATIVE-4
3
1. Unsigned Integer.
2. Index Data Item is a 16-bit integer in COBOL 74 and a 32-bit integer in HP COBOL85.
3. HP COBOL85 only.
4. INTEGER is normally equivalent to INTEGER*2. The INTEGER*4 and INTEGER*8 compiler directives
redefine INTEGER.