On this page
int32_t
Prev: stdint.h | Up: stdint.h | Next: int64_t
Rel: stdint.h, stdint, stdbool & limits Guide
Ref: cppreference — int32_t
Tags: #public #prog #c #stdlib #stdint #tier/core
Include
#include <stdint.h>
Signature & Overview
typedef /* signed 32-bit */ int32_t;
Exact 32-bit two's complement signed integer.
Notes & Pitfalls
- Exact 32-bit signed two's-complement integer: Prefer over
intorlongin file formats, network protocols, and FFI structs.
Example
#include <assert.h>
#include <stdint.h>
int main(void) {
int32_t x = -100000;
assert(sizeof(x) == 4 && x < 0);
}
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 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/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/uint32_t shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/stdint/uint64_t shared tags: #c, #prog, #stdint, #stdlib, #tier
- tuts/c/stdlib/stdint/uint8_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