write a function for strtok()??

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


Please Help Members By Posting Answers For Below Questions

Explain the use of bit fieild.

702


Write a program to implement queue.

654


what is the different bitween abap and abap-hr?

1737


What does the error message "DGROUP exceeds 64K" mean?

720


Explain Basic concepts of C language?

635






Explain the binary height balanced tree?

714


What are the features of the c language?

636


What is union in c?

626


Why malloc is faster than calloc?

578


What is signed and unsigned?

629


What does sizeof int return?

581


How to get string length of given string in c?

599


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

1584


What are the loops in c?

589


Is it possible to have a function as a parameter in another function?

592