logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

strlen - calculate the length of a string

Attributes

       For an explanation of the terms used in this section, see attributes(7).
       ┌─────────────────────────────────────────────────────────────────────────────┬───────────────┬─────────┐
       │ InterfaceAttributeValue   │
       ├─────────────────────────────────────────────────────────────────────────────┼───────────────┼─────────┤
       │ strlen()                                                                    │ Thread safety │ MT-Safe │
       └─────────────────────────────────────────────────────────────────────────────┴───────────────┴─────────┘

Description

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

History

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

Library

       Standard C library (libc, -lc)

Name

       strlen - calculate the length of a string

Notes

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

Return Value

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

See Also

string(3), strnlen(3), wcslen(3), wcsnlen(3)

Linux man-pages 6.9.1                              2024-06-15                                          strlen(3)

Standards

       C11, POSIX.1-2008.

Synopsis

#include<string.h>size_tstrlen(constchar*s);

See Also