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

how do you programme Carrier Sense Multiple Access

1518


What is main () in c?

588


What are c preprocessors?

679


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1454


Why can't I perform arithmetic on a void* pointer?

639






Why does the call char scanf work?

620


What is a structure and why it is used?

621


What are the 32 keywords in c?

637


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

646


What are the __date__ and __time__ preprocessor commands?

574


What does the && operator do in a program code?

698


What is a void * in c?

597


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

1699


what type of questions arrive in interview over c programming?

1559


Write a program on swapping (100, 50)

638