Technische Informatik; Hardwarenahe Programmierung
Beispiel uint8_t¶
uint8_t in Hederdatei <inttypes.h> oder bei MSVC <stdint.h>
u unsigned (also nur positive Zahlen, keine negativen)
uint unsigned int (also nur ganze positive Zahlen)
uint8 mit 8 Bit (also: 0 bis 255 ist char)
uint8_t das _t steht für: mit typedef definierter Aliasname für einen Datentyp (hier für unsigned char).
Type Keyword Bytes Range
character char 1 -128 .. 127
unsigned character unsigned char 1 0 .. 255
integer int 2 -32 768 .. 32 767
short integer short 2 -32 768 .. 32 767
long integer long 4 -2 147 483 648 .. 2 147 483 647
unsigned integer unsigned int 2 0 .. 65 535
unsigned short integer unsigned short 2 0 .. 65 535
unsigned long integer unsigned long 4 0 .. 4 294 967 295
single-precision floating-point (7 Stellen) float 4 1.17E-38 .. 3.4E38
double-precision floating-point (19 Stellen) double 8 2.2E-308 .. 1.8E308
Keyword Bytes Range C-Entsprechung (gcc)
int8_t 1 −128 .. 127 signed char
int16_t 2 −32768 .. 32767 signed short, signed int
int32_t 4 −2147483648 .. 2147483647 signed long
int64_t 8 −9223372036854775808 .. 9223372036854775807 signed long long
Keyword Bytes Range C-Entsprechung (gcc)
uint8_t 1 0 ..255 unsigned char
uint16_t 2 0 .. 65535 unsigned short, unsigned int
uint32_t 4 0 .. 4294967295 unsigned long
uint64_t 8 0 .. 18446744073709551615 unsigned long long
Character Type Output format
C, c int a single-byte character
d int Signed decimal integer.
i int Signed decimal integer.
o int Unsigned octal integer.
u int Unsigned decimal integer.
X, x int Unsigned hexadecimal integer
E, e, f, G, g double Signed value; form [–]d.dddd e [-]dd[d]
p Pointer Prints the address of the argument in hex.
S, s String specifies a single-byte–character string.