Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c program strtok use

/* strtok example */
#include <stdio.h>
#include <string.h>

int main ()
{
  char str[] ="- This, a sample string.";
  char * pch;
  printf ("Splitting string "%s" into tokens:
",str);
  pch = strtok (str," ,.-");
  while (pch != NULL)
  {
    printf ("%s
",pch);
    pch = strtok (NULL, " ,.-");
  }
  return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #program #strtok
ADD COMMENT
Topic
Name
6+1 =