# **[](https://en.cppreference.com/w/c/header/stdalign)** provides `alignas()` and `alignof()` (C11) for memory alignment control. `alignof(type)` returns its alignment requirement; `alignas(N)` forces a variable or struct member to align to N bytes. Use it for SIMD operations, hardware register access, or matching binary layouts. ## Example This example demonstrates alignment queries and enforces 16-byte alignment. ```c // compile: gcc -std=c11 -o alignexample alignexample.c // run: ./alignexample // description: query and enforce memory alignment #include #include #include int main() { printf("alignof(char) = %zu\n", alignof(char)); printf("alignof(int) = %zu\n", alignof(int)); printf("alignof(double) = %zu\n", alignof(double)); alignas(16) float vec[4]; printf("vec[0] address mod 16 = %zu (should be 0)\n", (uintptr_t)vec % 16); return 0; } ```