How to use strtok()
I'm writing a C program to study the usage of function strtok() . Here is my code: #include <stdio.h> #include <string.h> main() { char abc[100] = "ls &"; char *tok; tok = strtok(abc, " "); while (tok != NULL) { printf("%s", tok); tok = strtok(NULL, " "); } printf("\n\n\n\n\n%s", tok); return 0; } It is printing the following output: ls& (null) But I want it to print & at the second printf statement. How do I do it? I need this part for my homework project. Jonathan Leffler Make sure you can identify the limits of what you print when you're printing. Output newlines at the end of printed