the program for strtok given on http://www.opengroup.org/onlinepubs/000095399/functions/strtok.html crashes everytime..
#include ... char *t
strtok modifies the input string line.
strtok
line
char *line = "LINE TO BE SEPARATED";
In this case line points to the read-only memory. Hence, cannot be modified. You need to pass char array for strtok.