| Name | Description | Notes | Source | Availability | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
ATOMIC_ |
Lock-free property of type atomic_ |
? | M | <stdatomic.h> |
C11 | ||||||
atomic_ |
Atomic integer type | ? | T | <stdatomic.h> |
C11 | ||||||
atomic_ |
Atomic integer type | ? | T | <stdatomic.h> |
C11 | ||||||
INT_ |
Maximum value of int |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
INT_ |
Minimum value of int |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
int |
Signed integer type | L | T | Native | C89 | C90 | C95 | C99 | C11 | ||
UINT_ |
Maximum value of unsigned |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
unsigned |
Unsigned integer type | L | T | Native | C89 | C90 | C95 | C99 | C11 | ||
int is a signed integer type
with the range INT_
to INT_,
which is at least ±32767. It can also be called signed int, int
signed or signed. Use %d or
%i with printf to print an int. Use %d or
%i with scanf to scan an int. Constants of type int have no suffix.
Character constants
such as 's' have type int. int is also used by functions such as
getchar to return either a character or EOF to signify a lack of
further characters, by allowing both to be represented with
distinct values in a single type.
unsigned is an unsigned integer
type with the range 0 to
UINT_,
which is at least +65535. It can also be called int
unsigned or unsigned int. Use %u, %o,
%x or %X with printf to print an unsigned. Use %u,
%o or %x with scanf to scan an unsigned. Constants of type
unsigned are suffixed with
u or U.
sizeof(int) and sizeof(unsigned) are the same.
int and unsigned are intended to be the
‘natural size’ for an integer on the platform you're using.
They are usually wider than short and
unsigned short, and no
wider than long and
unsigned long.
atomic_
is an alias for _Atomic unsigned. atomic_
is an alias for _Atomic int. These types are lock-free always if
ATOMIC_ is
2, sometimes if 1, and never if 0.