What do'es the strok() do?
What do'es the strok() do?
never heard of it.....
did u mean strtok() ??
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
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; }
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.