October 2020
Beginner to intermediate
464 pages
8h 17m
English
Appendix D
Standard Data Types
|
Type |
Value Range |
Conversion Character |
|---|---|---|
|
void |
None |
None |
|
_Bool |
0 to 1 |
%d |
|
char |
–128 to 127 |
%c |
|
unsigned char |
0 to 255 |
%u |
|
short int |
–32,768 to 32,767 |
%d |
|
unsigned short int |
0 to 65,535 |
%u |
|
int |
–2,147,483,648 to 2,147,483,647 |
%d |
|
unsigned int |
0 to 4,294,967,295 |
%u |
|
long int |
–2,147,483,648 to 2,147,483,647 |
%ld |
|
unsigned long int |
0 to 4,294,967,295 |
%lu |
|
long long |
-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 |
%lld |
|
unsigned long long |
0 to 18,446,744,073,709,551,615 |
%llu |
|
float |
1.2×10–38 to 3.4×1038 |
%e, %f, %g |
|
Double |
2.3×10–308 to 1.7×10308 |
%e, %f, %g |
|
long double |
3.4×10–4932 to 1.1×104932 |
%e, %f, %g |
The %i placeholder generates integer output, the same as %d. (Think %i for integer, but %d for decimal.)
%x placeholder outputs integer values in hexadecimal. When %X is specified, numbers A through F are output in uppercase.%o placeholder outputs integer values in octal.limits.h header file lists the sizes of data types.%z, though %zu (unsigned) and %zd (decimal output) are also used.Read now
Unlock full access