Ok, so I understand that strtok modifies its input argument, but in this case, it\'s collapsing down the input string into only the first token. Why is this happening, and w
You should printout the token that you receive from strtok and not worry about the input array because NULLs will be inserted by strtok. You need repeated calls to get all of the tokens:
#include
#include
#include
int main(int argc, char* argv[]) {
char input[]="this is a test of the tokenizor seven";
char * temp;
temp=strtok(input," ");
while( temp != NULL ) {
printf("temp is \"%s\"\n", temp );
temp = strtok( NULL, " ");
}
}