String Tokenizer Function

why we pass the null string after passing a string???

strtok() keeps some data in static variables inside the function itself so it can continue a searching from the point it left it the previous call. To signal strtok() that you want to keep searching the same string, you pass a NULL pointer as its first argument. strtok() checks whether it is NULL and if it is so, it uses its currently stored data. If the first parameter is not null, it is treated as a new search and all internal data is resetted.

Please watch its vedio again to understand this concept more clearly.