File: countof.3

package info (click to toggle)
manpages 6.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,476 kB
  • sloc: sh: 576; python: 222; perl: 191; makefile: 29; lisp: 22
file content (35 lines) | stat: -rw-r--r-- 769 bytes parent folder | download
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 2025-08-19 "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)