If I simply just want to tokenize the first element of a string and then output the remainder of the string, how can this be accomplished?
thanks
#include <stdio.h>
#include <string.h>
int main(){
const char* line= "0 firstline";
char* l = strdup(line);
printf("beforeToknization:\t%s\n",l);
char *tok = strtok(l," ");
printf("firstToken:%s\trestOfLine:%s\n",tok,l);
return 0;
}
./a.out
beforeToknization: 0 firstline
firstToken:0 restOfLine:0