Answer Posted / yogesh
strtok() function is used for tokanizing the given string.
The output of the following program will be as follows.
How|are|you|I|am|Fine.
#include<stdio.h>
int main()
{
char *p;
char str[40]="How are you,I am Fine";
p=strtok(str," ");
printf("%s",p);
do
{
p=strtok('\0',", ");
if(p)
printf("|%s",p);
}while(p);
printf("\n");
}
| Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
Explain modulus operator. What are the restrictions of a modulus operator?
What are nested functions in c?
Explain the use of #pragma exit?
What is the use of bit field?
What's a good way to check for "close enough" floating-point equality?
Why does notstrcat(string, "!");Work?
What is the difference between a function and a method in c?
explain what are actual arguments?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
Why do we use int main?
What is the method to save data in stack data structure type?
What is typedef example?
Why is sprintf unsafe?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is ctrl c called?