strlen
Section: C Library Functions (3)
Updated: 2026-02-25
Index
JM Home Page
roff page
名前
strlen - 文字列の長さを計算する
ライブラリ
標準 C ライブラリ (libc,~-lc)
書式
#include <string.h>
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').
It is equivalent to
strnul(s) - s
返り値
strlen() 関数は s が指す文字列のバイト数を返す。
属性
この節で使用されている用語の説明については、 attributes(7) を参照。
| インターフェース | 属性 | 値
|
|
strlen()
| Thread safety | 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), strnul(3), wcslen(3), wcsnlen(3)
Index
- 名前
-
- ライブラリ
-
- 書式
-
- 説明
-
- 返り値
-
- 属性
-
- 標準規格
-
- 歴史
-
- 注意
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.