wcstok

Autres langues

Langue: ja

Autres versions - même langue

Version: July 25, 1999 (openSuse - 09/10/07)

Section: 3 (Bibliothèques de fonctions)

̾Á°

wcstok - ¥ï¥¤¥Éʸ»úʸ»úÎó¤ò¥È¡¼¥¯¥ó¤Ëʬ³ä¤¹¤ë

½ñ¼°


#include <wchar.h>



wchar_t *wcstok(wchar_t *wcs, const wchar_t *delim, wchar_t **ptr);

ÀâÌÀ

wcstok() ´Ø¿ô¤Ï¡¢ strtok(3) ´Ø¿ô¤ËÂбþ¤¹¤ë¥ï¥¤¥Éʸ»ú´Ø¿ô¤Ë¡¢ ¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤ÎÆ°ºî¤ò¤µ¤»¤ë¤¿¤á¤Î°ú¤­¿ô¤òÄɲä·¤¿¤â¤Î¤Ç¤¢¤ë¡£ ¤³¤Î´Ø¿ô¤òÍѤ¤¤Æ¡¢¥ï¥¤¥Éʸ»úʸ»úÎó wcs ¤ò¥È¡¼¥¯¥ó¤Ëʬ²ò¤¹¤ë¤³¤È ¤¬¤Ç¤­¤ë¡£¤³¤³¤Ç¡¢¥È¡¼¥¯¥ó¤Ï delim ¤ËÎóµó¤µ¤ì¤Æ¤¤¤ëʸ»ú¤ò´Þ¤Þ¤Ê ¤¤Éôʬʸ»úÎó¤È¤·¤ÆÄêµÁ¤µ¤ì¤ë¡£

¸¡º÷¤Ï wcs ¤¬ NULL ¤Ç¤Ê¤±¤ì¤Ð wcs ¤«¤é³«»Ï¤µ¤ì¡¢wcs ¤¬ NULL ¤Ê¤é¤Ð *ptr ¤«¤é³«»Ï¤µ¤ì¤ë¡£¤Þ¤º¡¢Á´¤Æ¤Î¶èÀÚ¤ê¥ï¥¤¥Éʸ»ú ¤¬¥¹¥­¥Ã¥×¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¡¢delim ¤Ë´Þ¤Þ¤ì¤ë¥ï¥¤¥Éʸ»ú¤òĶ¤¨¤ë¤è¤¦ ¤Ë¥Ý¥¤¥ó¥¿¤¬Á°¤Ë¿Ê¤á¤é¤ì¤ë¡£ ¥ï¥¤¥Éʸ»úʸ»úÎó¤Î½ª¤ï¤ê¤Ë㤷¤¿¤é¡¢ wcstok() ¤Ï NULL ¤òÊÖ¤·¤Æ ¥È¡¼¥¯¥ó¤¬Á´¤¯¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¡¢¤³¤Î¸å¤Ë wcstok() ¤ò¸Æ¤Ó ½Ð¤·¤Æ¤â NULL ¤¬ÊÖ¤µ¤ì¤ë¤è¤¦¤Ë *ptr ¤ËŬÀÚ¤ÊÃͤòÀßÄꤹ¤ë¡£¤½¤ì °Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢ wcstok() ´Ø¿ô¤Ï¥È¡¼¥¯¥ó¤ÎÀèƬ¤ò¼±Ê̤·¡¢¤³¤ì¤ò»Ø¤¹ ¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¤¿¤À¤·¤³¤ì¤ò¹Ô¤¦Á°¤Ë¡¢¥È¡¼¥¯¥ó¤Î¸å¤Ë¤¢¤ë¡¢delim ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ëʸ»ú¤ò L'\0' ¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥È¡¼¥¯¥ó¤ò 0 ¤Ç ½ªÃ¼¤µ¤»¤ë¡£¤µ¤é¤Ë *ptr ¤ò¹¹¿·¤·¡¢¸å¤Ç wcstok() ¤ò¸Æ¤Ó½Ð¤·¤¿ ºÝ¤Ë¡¢¼±Ê̤µ¤ì¤¿¥È¡¼¥¯¥ó¤Î³¤­¤«¤é¸¡º÷¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¡£

ÊÖ¤êÃÍ

wcstok() ´Ø¿ô¤Ï¼¡¤Î¥È¡¼¥¯¥ó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£¥È¡¼¥¯¥ó¤¬¸«¤Ä¤«¤é ¤Ê¤±¤ì¤Ð NULL ¤òÊÖ¤¹¡£

½àµò

C99.

Ãí°Õ

´Ø¿ô¤ËÍ¿¤¨¤¿¥ï¥¤¥Éʸ»úÎó wcs ¤Ï¡¢´Ø¿ô¤ÎÆ°ºî¤Ë¤è¤Ã¤Æ´°Á´¤Ë½ñ¤­´¹ ¤¨¤é¤ì¤ë¡£

Îã

°Ê²¼¤Î¥³¡¼¥É¤Ï¡¢¥ï¥¤¥Éʸ»úʸ»úÎó¤Ë´Þ¤Þ¤ì¤ë¥È¡¼¥¯¥ó¤ò¼è¤ê½Ð¤·¤Ê¤¬¤é ¥ë¡¼¥×¤¹¤ë¡£

wchar_t *wcs = ...;

wchar_t *token;

wchar_t *state;

for (token = wcstok(wcs, " \t\n", &state);

    token != NULL;

    token = wcstok(NULL, " \t\n", &state)) {

    ...

}

´ØÏ¢¹àÌÜ

strtok(3), wcschr(3)