Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 modulus operator. What are the restrictions of a modulus operator?

1016


What are nested functions in c?

1019


Explain the use of #pragma exit?

1181


What is the use of bit field?

1182


What's a good way to check for "close enough" floating-point equality?

1162


Why does notstrcat(string, "!");Work?

1144


What is the difference between a function and a method in c?

1083


explain what are actual arguments?

1091


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?

1135


Why do we use int main?

1101


What is the method to save data in stack data structure type?

1087


What is typedef example?

1188


Why is sprintf unsafe?

1075


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1393


What is ctrl c called?

1048