Compiles fine on which compiler? It should at least generate a warning because you are assigning a literal string to char *. Then you are calling strtok which modifies it - undefined behaviour.
Change the line to
and you should find the program works.Code:char test [] = "Hello there how is everyone"




Reply With Quote