Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

c programing 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: #programing #strtok
ADD COMMENT
Topic
Name
1+9 =