W3cubDocs

/C++

C++ keyword: alignof (since C++11)

Usage

Example

#include <cstddef>
#include <iostream>
 
int main()
{
    std::cout << alignof(std::max_align_t) << '\n';
}

Possible output:

16

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/keyword/alignof