Scroll Down to See All
abortabsacosasctimeasctime_rasinassertatanatan2atexitatofatoiatolbsearchbtowccalloccatclosecatgetscatopenceilclearerrclockcoscoshctimectime_rdifftimediverferfcexitexpfabsfclosefdopenfeofferrorfflushfgetcfgetposfgetsfgetwcfgetwsfopenfprintffputcfputwsfreadfreefreopenfrexpfscanffseekfsetposftellfwidefwprintffwritefwscanfgetcgetchargetenvgetwcgetwchargmtimegmtime_rhypotisalnumisalphaisasciiisblankiscntrlisdigitisgraphislowerisprintispunctisspaceisupperiswalnumiswalphaiswblankiswcntrliswctypeiswdigitiswgraphiswloweriswprintiswpunctiswspaceiswupperiswxdigitisxdigitj0j1jnlabsldexpldivlocaleconvlocaltimelocaltime_rloglog10longjmpmallocmblenmbrlenmbrtowcmbsinitmbsrtowcsmbstowcsmbtowcmemchrmemcmpmemcpymemmovememsetmktimemodfnextafternextafterlnexttowardnexttowardlnl_langinfoperrorpowprintfputcputcharputenvputsputwcputwcharqsortquantexpd32quantexpd64quantexpd128quantized32quantized64quantized128samequantumd32raiserandrand_rreallocregcompregerrorregexecregfreeremoverenamerewindscanfsetbufsetjmpsetlocalesetvbufsignalsinsinhsnprintfsprintfsqrtsrandsscanfstrcasecmpstrcatstrchrstrcmpstrcollstrcpystrcspnstrerrorstrfmonstrftimestrlenstrncasecmpstrncatstrncmpstrncpystrpbrkstrptimestrrchrstrspnstrstrstrtodstrtod32strtod64strtod128strtofstrtok_rstrtolstrtoldstrtoulstrxfrmswprintfswscanfsystemtantanhtimetime64tmpfiletmpnamtoasciitolowertouppertowctranstowlowertowupperungetcungetwcva_argva_copyva_endva_startvfprintfvfscanfvfwprintfvfwscanfvprintfvscanfvsprintfvsnprintfvsscanfvswprintfvswscanfvwprintfvwscanfwcrtombwcscatwcschrwcscmpwcscollwcscpywcscpywcsftimewcslenwcsncatwcsncmpwcsncpywcspbrkwcsptimewcsrchrwcsrtombswcsspnwcsstrwcstodwcstod32wcstod64wcstod128wcstofwcstokwcstolwcstoldwcstombswcstoulwcsxfrmwctobwctombwctranswctypewcwidthwmemchrwmemcmpwmemcpywmemmovewmemsetwprintfwscanfy0y1yn



Function Details : strtok

char *strtok(char * str,const char * delim) ;

Return Type : char *

String pointer (array of characters)
Read about return values of strtok function .

1st Parameter Type : char *

String pointer (array of characters)

1st Parameter

Pointer to the null-terminated string to be tokenized. On subsequent calls, this should be `NULL` to continue tokenization of the same string.

2nd Parameter Type : const char *

Pointer to read-only string

2nd Parameter

Pointer to a null-terminated string containing the delimiter characters. These characters separate the tokens in `str`.

Read more about parameters of strtok in parameters section
The strtokfunction in C language Tokenizes a string into sequences separated by the delimiters specified.
The strtok function breaks a string into a sequence of zero or more nonempty tokens. On the first call, the string to be parsed should be specified in str. In each subsequent call that should parse the same string, str must be NULL. The delimiters used to identify token boundaries can be different from call to call.
The strtokfunction takes 2 parameters:
  • char * `str`: Pointer to the null-terminated string to be tokenized. On subsequent calls, this should be `NULL` to continue tokenization of the same string.
  • const char * `delim`: Pointer to a null-terminated string containing the delimiter characters. These characters separate the tokens in `str`.
Splits the string `str` into tokens using the characters in `delim` as delimiters. On the first call, `str` must be the input string to tokenize. On subsequent calls, `str` should be `NULL`. Returns a pointer to the next token or `NULL` if there are no more tokens.
The strtok function return value :
  • Returns a pointer to the next token, or NULL if there are no more tokens

Output

This example demonstrates basic usage of strtok to split a string into tokens based on a delimiter.