C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

Table 8 Predefined Data Types (continued)
Abbreviated formsLong forms
long longlong long int
decimaldecimal
floatfloat
doubledouble
long doublelong double
1
The bool type became available at the D45 release with native C++ using the VERSION2 directive.
decimal
The data type decimal is an HP extension. decimal is applicable only for the native C and TNS
C languages, which use the pragma SQL.
decimal specifies the predefined decimal type, which is used to access data in an SQL database.
If you use decimal, you must specify the SQL pragma. If you want functions to manipulate
decimal variables, you must specify the SQL pragma and include the header sqlh. For more
details regarding the use of the data type decimal, see the NonStop SQL/MP Programming
Manual for C.
long long
The data type long long is a 64-bit integer. This HP extension is applicable for the native and
TNS C and C++ languages.
For TNS C++, type matching occurs for initialization, expressions, and argument lists. Variables
of type long long are allowed in all contexts that TNS C allows them. Constants of type long
long are recognized when the decimal number is followed by the modifier LL or ll. Variables
and constants of type long long are allowed in classes and templates.
unsigned long long
The data type unsigned long long is an unsigned 64-bit integer. This HP extension is applicable
for both the TNS/R and TNS/E native C and C++ languages.
signed char
The data type signed char is an HP extension to Cfront, the TNS C++ preprocessor. The data
type signed char can be used to distinguish a specific instance of an overloaded member
function.
Size of Type int
For native C and C++, the data type int is always 32 bits.
For TNS OSS programs, the data type int is always 32 bits. For TNS Guardian programs, the
size of the data type int can be 16 bits or 32 bits, depending on whether you have specified the
32-bit (wid) data model. To specify the 32-bit (wide) data model, use the WIDE pragma. The WIDE
pragma compiles only under the large-memory model.
For TNS C, a C program runs under the large-memory model unless you have specified the NOXMEM
pragma.
For TNS C++, a C++ program always runs under the large-memory model. In addition, the 32-bit
(wide) data model is the default specification. If you want the size of the data type int to be 16
bits, specify the NOWIDE pragma.
64 C and C++ Extensions