countof(3) Library Functions Manual countof(3) NAME countof, _Countof - count the number of elements in an array LIBRARY Standard C library (libc) SYNOPSIS #include size_t countof(array); DESCRIPTION This operator counts the number of elements in an array. If the operand is not an array, it produces a compilation error. There's a keyword, _Countof(), that behaves identically, and can be used without including . RETURN VALUE The number of elements in the array. STANDARDS C2y. HISTORY gcc 16, clang 21. SEE ALSO operator(7) Linux man-pages 6.16 2025-08-19 countof(3)