INDEX
Section: Linux Programmer's Manual (3)
Updated: 2009-03-15
Index
JM Home Page
roff page
名前
index, rindex - 文字列中の文字の位置を示す
書式
#include <strings.h>
char *index(const char *s, int c);
char *rindex(const char *s, int c);
説明
index()
関数は、文字列 s 中に最初に文字 c が
現れた位置へのポインタを返す。
rindex()
関数は、文字列 s 中に最後に文字 c が
現れた位置へのポインタを返す。
文字列を終端する NULL 文字は、文字列の一部とみなされる。
返り値
index()
と
rindex()
関数は、一致した文字へのポインタか、
もし文字が見つからない場合は NULL を返す。
準拠
4.3BSD;
POSIX.1-2001 では「過去の名残 (LEGACY)」と位置付けられている。
POSIX.1-2008 では
index()
と
rindex()
の仕様が削除されている。
代わりに、
strchr(3)
と
strrchr(3)
の使用が推奨されている。
関連項目
memchr(3),
strchr(3),
strpbrk(3),
strrchr(3),
strsep(3),
strspn(3),
strstr(3),
strtok(3)
Index
- 名前
-
- 書式
-
- 説明
-
- 返り値
-
- 準拠
-
- 関連項目
-
This document was created by
man2html,
using the manual pages.
Time: 03:26:45 GMT, April 25, 2010