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 | ||||||
SHRT_ |
Maximum value of short |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
SHRT_ |
Minimum value of short |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
short |
Signed integer type | L | T | Native | C89 | C90 | C95 | C99 | C11 | ||
USHRT_ |
Maximum value of unsigned short |
L | M | <limits.h> |
C89 | C90 | C95 | C99 | C11 | ||
unsigned short |
Unsigned integer type | L | T | Native | C89 | C90 | C95 | C99 | C11 |
short
is a signed integer type
with the range SHRT_
to SHRT_
,
which is at least ±32767. It can also be called signed short
or short
signed
. Use %d or
%i with printf
to print an short
. Use %hd or
%hi with scanf
to scan an short
.
unsigned short
is an unsigned integer
type with the range 0
to
USHRT_
,
which is at least +65535. It can also be called short
unsigned
. Use %u,
%o, %x or %X with
printf
to print an unsigned short
. Use %hu,
%ho or %hx with scanf
to scan an unsigned short
.
sizeof(short)
and sizeof(unsigned short)
are the same. short
and unsigned short
are intended to be of a ‘compact
size’ for an integer on the platform you're using. They are
usually wider than char
,
signed char
and
unsigned char
, and no
wider than int
and
unsigned
.
atomic_
is an alias for _Atomic unsigned short
. atomic_
is an alias for _Atomic short
. These types are lock-free always if
ATOMIC_
is
2
, sometimes if 1
, and never if 0
.