What do'es the strok() do?:(
Printable View
What do'es the strok() do?:(
never heard of it.....
did u mean strtok() ??
A strtok example
Code:#include <stdio.h>
#include <string.h>
int main ( ) {
/* a string, which must be in writable memory */
char msg[] = "sia john kim dave kelly earth moon door room";
char delim[] = " "; /* the delimiters - just a space in this case */
char *token;
int count = 0;
for ( token = strtok(msg,delim) ; token ; token = strtok(NULL,delim) ) {
count++;
printf("C=%d, T=`%s'\n", count, token );
}
return 0;
}