blob: 4de30cbdd6b56904a80f947840be2135b1222065 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.TH countof 3 (date) "Linux man-pages (unreleased)"
.SH NAME
countof, _Countof \- count the number of elements in an array
.SH LIBRARY
Standard C library
.RI ( libc )
.SH SYNOPSIS
.nf
.B #include <stdcountof.h>
.P
.BI "size_t countof(" array );
.fi
.SH DESCRIPTION
This operator counts the number of elements in an array.
.P
If the operand is not an array,
it produces a compilation error.
.P
There's a keyword,
.BR \%_Countof (),
that behaves identically,
and can be used without including
.IR <stdcountof.h> .
.SH RETURN VALUE
The number of elements in the array.
.SH STANDARDS
C2y.
.SH HISTORY
gcc 16, clang 21.
.SH SEE ALSO
.BR operator (7)
|