strtok()

Syntax
  #include <string.h>

  
  char *strtok(char *p, const char *q);

  
Description

strtok() breaks the string p into tokens, separated by at least one character appearing in q. The first time, call strtok() using the original string as the first parameter. Afterwards, pass NULL as first parameter: strtok() continues from its previous stopping position. strtok() saves the string p unless it is NULL.

Note: This function is not re-entrant because it uses a global variable for saving string p. ANSI defines this function in this way.
Return

A pointer to the token found, or NULL, if no token was found.

See also

strchr()

strcspn()

strpbrk()

strrchr()

strspn()

strstr()