1strlen(3)                  Library Functions Manual                  strlen(3)
2
3
4

NAME

6       strlen - calculate the length of a string
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <string.h>
13
14       size_t strlen(const char *s);
15

DESCRIPTION

17       The strlen() function calculates the length of the string pointed to by
18       s, excluding the terminating null byte ('\0').
19

RETURN VALUE

21       The strlen() function returns the number of bytes in the string pointed
22       to by s.
23

ATTRIBUTES

25       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
26       tributes(7).
27
28       ┌────────────────────────────────────────────┬───────────────┬─────────┐
29Interface                                   Attribute     Value   
30       ├────────────────────────────────────────────┼───────────────┼─────────┤
31strlen()                                    │ Thread safety │ MT-Safe │
32       └────────────────────────────────────────────┴───────────────┴─────────┘
33

STANDARDS

35       C11, POSIX.1-2008.
36

HISTORY

38       POSIX.1-2001, C89, SVr4, 4.3BSD.
39

NOTES

41       In cases where the input buffer may  not  contain  a  terminating  null
42       byte, strnlen(3) should be used instead.
43

SEE ALSO

45       string(3), strnlen(3), wcslen(3), wcsnlen(3)
46
47
48
49Linux man-pages 6.04              2023-03-30                         strlen(3)
Impressum