| 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 | ||||||
LONG_ |
Maximum value of long |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
LONG_ |
Minimum value of long |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
long |
Signed integer type | L | T | Native | C89 | C90 | C95 | C99 | C11 | ||
ULONG_ |
Maximum value of unsigned long |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
unsigned long |
Unsigned integer type | L | T | Native | C89 | C90 | C95 | C99 | C11 | ||
long is a signed integer type
with the range LONG_
to LONG_,
which is at least ±2147483647. It can also be called
signed long or long signed. Use %ld or
%li with printf to print an long. Use %ld or
%li with scanf to scan an long. Constants of type
long are suffixed with
l or L.
unsigned long is an unsigned integer
type with the range 0 to
ULONG_,
which is at least +4294967295. It can also be called
long unsigned. Use %lu,
%lo, %lx or %lX with
printf to print an unsigned long. Use %lu,
%lo or %lx with scanf to scan an unsigned long. Constants of type
unsigned long are suffixed with
ul, Ul,
lu, lU,
uL, UL,
Lu or LU.
sizeof(long) and sizeof(unsigned long) are the same. long and unsigned long are intended to be
potentially wider than int and
unsigned, and
no wider than long
long and
unsigned long long. However,
they are often identical to int and
unsigned.
The standard library rarely uses long and unsigned long, unless it offers
alternatives for int and
unsigned as
well. One exception is as file positions with fseek and ftell.
atomic_
is an alias for _Atomic unsigned long. atomic_
is an alias for _Atomic long. These types are lock-free always if
ATOMIC_ is
2, sometimes if 1, and never if 0.