Names specified here
Name Description Notes Source Availability
ATOMIC_LONG_LOCK_FREE Lock-free property of type atomic_long ? M <stdatomic.h> C11
atomic_long Atomic integer type ? T <stdatomic.h> C11
atomic_ulong Atomic integer type ? T <stdatomic.h> C11
LONG_MAX Maximum value of long L M <limits.h> C89 C90 C95 C99 C11
LONG_MIN 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_MAX 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_MIN to LONG_MAX, 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_MAX, 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_ulong is an alias for _Atomic unsigned long. atomic_long is an alias for _Atomic long. These types are lock-free always if ATOMIC_LONG_LOCK_FREE is 2, sometimes if 1, and never if 0.


CHaR
Sitemap Supported
Site format updated 2024-06-05T22:37:07.391+0000
Data updated 1970-01-01T00:00:00.000+0000
Page updated 2022-06-17T21:43:05.000+0000