Quick actions

cmd+k|ctrl+k

Navigation

Languages

Arrays / Array size type safe at compile time / Essential C++

Snippet info

Language

Cpp

Visibility

public

Author

kkowalczyk

Created

2019-03-27T06:48:29Z

Updated

2019-03-27T06:48:29Z

#include <iostream>

int main(int argc, char **argv)
{
    char MyArray[] = { 'X','o','c','e' };
    const auto n = std::extent<decltype(MyArray)>::value;
    std::cout << n << "\n";
}
INFO