strlen(3) Library Functions Manual strlen(3) strlen - C (libc, -lc) #include size_t strlen(const char *s); The strlen() function calculates the length of the string pointed to by s, excluding the terminating null byte ('\0'). strlen() , s. attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |strlen() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ C11, POSIX.1-2008. POSIX.1-2001, C89, SVr4, 4.3BSD. In cases where the input buffer may not contain a terminating null byte, strnlen(3) should be used instead. string(3), strnlen(3), wcslen(3), wcsnlen(3) () Alexander Golubev , Azamat Hackimov , Hotellook, Nikita , Spiros Georgaras , Vladislav , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.9.1 15 2024 . strlen(3)