EN JA
STRLEN(3)
STRLEN(3) FreeBSD Library Functions Manual STRLEN(3)

名称

strlen, strnlen文字列の長さを求める

ライブラリ

Standard C Library (libc, -lc)

書式

#include < string.h>

size_t
strlen( const char *s);

size_t
strnlen( const char *s, size_t maxlen);

解説

strlen() 関数は、文字列 s の長さを計算します。 strnlen() 関数は、 s の長さを計算することを試みますが、 s の最初の maxlen バイトを超えて決してスキャンしません。

戻り値

strlen() 関数は、終端の ヌル 文字の前までの文字数を返します。 strnlen() 関数は、 strlen() または maxlen と同じ結果の小さい方のいずれかを返します。

規格

strlen() 関数は、 ISO/IEC 9899:1990 (“ISO C90”) に適合しています。 strnlen() 関数は、 IEEE Std 1003.1-2008 (“POSIX.1”) に適合しています。
February 28, 2009 FreeBSD