Integral types
- Signed integer types:
- signed char
- short int
- int
- long int
- long long int
- Unsigned integer types:
- unsigned char
- unsigned short int
- unsigned int
- unsigned long int
- unsigned long long int
z/OS® XL C++ supports the long long
data type
for language levels other than ANSI by default. You can also control the support for long
long
using the LONGLONG suboption of LANGLVL. For example, specifying LANGLVL(ANSI,
LONGLONG) would add the long long
data type to the ISO language level. Refer to the
z/OS XL C/C++ User's Guide for
information on using the LANGLVL option.
The unsigned
prefix indicates that the
object is a nonnegative integer. Each unsigned type provides the same
size storage as its signed equivalent. For example, int
reserves
the same storage as unsigned int
. Because a signed
type reserves a sign bit, an unsigned type can hold a larger positive
integer value than the equivalent signed type.
The declarator for a simple integer definition or declaration is an identifier. You can initialize a simple integer definition with an integer constant or with an expression that evaluates to a value that can be assigned to an integer.
When the arguments
in overloaded functions and overloaded operators are integer types,
two integer types that both come from the same group are not treated
as distinct types. For example, you cannot overload an int
argument
against a signed int
argument.