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
Code:
char test [] = "Hello there how is everyone"
and you should find the program works.