0% found this document useful (0 votes)
25 views1 page

C data types - Wikipedia

Uploaded by

iuogh71
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

C data types - Wikipedia

Uploaded by

iuogh71
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

16/11/2024 10:58 C data types - Wikipedia

Minimum Suffix for


Format
Type Explanation size Range decimal
specifier
(bits) constants

Smallest addressable unit of the machine that can


contain basic character set. It is an integer type. Actual [CHAR_MIN,
char type can be either signed or unsigned. It contains 8 %c —
CHAR_MAX]
CHAR_BIT bits.[3]
Of the same size as char, but guaranteed to be
[SCHAR_MIN,
signed char signed. Capable of containing at least the [−127, +127] 8 %c[b] —
SCHAR_MAX][6]
range.[3][a]
Of the same size as char, but guaranteed to be [0,
unsigned char 8 %c[c] —
unsigned. Contains at least the [0, 255] range.[7] UCHAR_MAX]

short
short int Short signed integer type. Capable of containing at [SHRT_MIN,
16 %hi or %hd —
signed short least the [−32 767, +32 767] range.[3][a] SHRT_MAX]
signed short int

unsigned short Short unsigned integer type. Contains at least the [0,
16 %hu —
unsigned short int [0, 65 535] range.[3] USHRT_MAX]

int
Basic signed integer type. Capable of containing at [INT_MIN,
signed 16 %i or %d none[8]
least the [−32 767, +32 767] range.[3][a] INT_MAX]
signed int

unsigned Basic unsigned integer type. Contains at least the


16 %u [0, UINT_MAX] u or U[8]
unsigned int [0, 65 535] range.[3]

long
long int Long signed integer type. Capable of containing at [LONG_MIN,
32 %li or %ld l or L[8]
signed long least the [−2 147 483 647, +2 147 483 647] range.[3][a] LONG_MAX]
signed long int

unsigned long both u or


Long unsigned integer type. Capable of containing at [0,
32 %lu U and l or
unsigned long int least the [0, 4 294 967 295] range.[3] ULONG_MAX]
L[8]

long long Long long signed integer type. Capable of containing


long long int at least the
%lli or [LLONG_MIN,
[−9 223 372 036 854 775 807, +9 223 372 036 854 775 807] 64
%lld LLONG_MAX] ll or LL[8]
signed long long
range.[3][a] Specified since the C99 version of the
signed long long int standard.

unsigned long long Long long unsigned integer type. Contains at least the both u or
[0,
[0, 18 446 744 073 709 551 615] range.[3] Specified since 64 %llu
ULLONG_MAX]
U and ll
unsigned long long int
the C99 version of the standard. or LL[8]
Converting
Real floating-point type, usually referred to as a single- from
precision floating-point type. Actual properties
unspecified (except minimum limits); however, on most text:[d]
float systems, this is the IEEE 754 single-precision binary %f %F f or F
floating-point format (32 bits). This format is required %g %G
by the optional Annex F "IEC 60559 floating-point %e %E
arithmetic".
%a %A

Real floating-point type, usually referred to as a


double-precision floating-point type. Actual properties %lf %lF
unspecified (except minimum limits); however, on most %lg %lG
double systems, this is the IEEE 754 double-precision binary none
%le %lE
floating-point format (64 bits). This format is required
[e]
by the optional Annex F "IEC 60559 floating-point %la %lA
arithmetic".

Real floating-point type, usually mapped to an


extended precision floating-point number format.
Actual properties unspecified. It can be either x86 %Lf %LF
extended-precision floating-point format (80 bits, but %Lg %LG
long double typically 96 bits or 128 bits in memory with padding %Le %LE l or L
bytes), the non-IEEE "double-double" (128 bits), IEEE
754 quadruple-precision floating-point format (128 %La %LA[e]
bits), or the same as double. See the article on long
double for details.

a. The minimal ranges [−(2n−1−1), 2n−1−1] (e.g. [−127,127]) come from the various integer representations allowed by
the standard (ones' complement, sign-magnitude, two's complement).[4] However, most platforms use two's
complement, implying a range of the form [−2m−1, 2m−1−1] with m ≥ n for these implementations, e.g. [−128,127]
https://en.wikipedia.org/wiki/C_data_types 2/9

You might also like