String Tokenizer - II : Implemenation using Dynamic Array & Static Pointers

preview_player
Показать описание
Learn to implement String Tokenizer in C++.
Рекомендации по теме
Комментарии
Автор

what if there is two or three commas instead of one?plz reply asap

zaghumsarwar
Автор

Can anyone explain to me what the below for loop does and how it works please?
void tokenize(char *line, char **words, int *nwords)
{
*nwords=1;
for(words[0]=strtok(line, " \t\n");
(*nwords<MAX_WORDS)&&(words[*nwords]=strtok(NULL, " \t\n"));
*nwords=*nwords+1
); /* empty body */
return;
}

iamthejustin
Автор

Very nice video. I really like the way of teaching. Bhaiya u r so calm while teaching. And ur approach is very nice. Like u tried to figure out first that how the original function is working ... And what all things we will require... And why to reject static array....
Basically the approach is important and I am trying to learn this from you by observing....
Thanks alot..

raghavgupta
Автор

Can anyone explain to me what the below for loop does and how it works please?
void tokenize(char *line, char **words, int *nwords)
{
*nwords=1;
for(words[0]=strtok(line, " \t\n");
(*nwords<MAX_WORDS)&&(words[*nwords]=strtok(NULL, " \t\n"));
*nwords=*nwords+1
); /* empty body */
return;
}

iamthejustin
join shbcf.ru