On this page
uint8_t
Prev: int64_t | Up: stdint.h | Next: uint32_t
Rel: stdint.h, stdint, stdbool & limits Guide
Ref: cppreference — uint8_t
Tags: #public #prog #c #stdlib #stdint #tier/core
Include
#include <stdint.h>
Signature & Overview
typedef /* unsigned 8-bit */ uint8_t;
Exact 8-bit unsigned byte (0..255) for binary protocols and buffers.
Notes & Pitfalls
- Exact 8-bit unsigned byte (
0..255): Standard element type for binary buffers, packet parsers, and crypto APIs.
Example
#include <assert.h>
#include <stdint.h>
int main(void) {
uint8_t header[2] = {0xDE, 0xAD};
assert(header[0] == 0xDE && header[1] == 0xAD);
}
Linked from
Related notes
- tuts/c/stdlib/stdint/int64_t Linked here; links to this page; shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/stdint/uint32_t Linked here; links to this page; shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/stdint Linked here; links to this page; shared tags: #c, #prog, #stdint, #stdlib
- tuts/c/stdlib/stdint_stdbool_and_limits Linked here; shared tags: #c, #prog, #stdlib
- tuts/c/stdlib/stdint/int32_t shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/stdint/PRIu64 shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/stdint/SIZE_MAX shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/stdint/uint64_t shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/stdint/uintptr_t shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/assert/assert shared tags: #c, #prog, #stdlib, #tier