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...

Tell about strtok & strstr functions

Answer Posted / swetcha


include <string.h>

char *strstr (char * s1 , const char * s2 );

In the above case
The strstr function locates the first occurrence in the
string pointed to by s1 of the sequence of characters
(excluding the terminating null character) in the string
pointed to by s2.

The strstr function returns a pointer to the located
string, or a null pointer if the string is not found. If s2
points to a string with zero length, the function returns
s1.
The strtok function
See the below case
#include <string.h>

char *strtok (char * s1 , const char * s2 );


A sequence of calls to the strtok function breaks the
string pointed to by s1 into a sequence of tokens, each of
which is delimited by a character from the string pointed
to by s2. The first call in the sequence has s1 as its
first argument, and is followed by calls with a null
pointer as their first argument. The separator string
pointed to by s2 may be different from call to call.


The strtok function returns a pointer to the first
character of a token, or a null pointer if there is no token

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data structure in c programming?

1132


What is the process of writing the null pointer?

1065


Once I have used freopen, how can I get the original stdout (or stdin) back?

1122


Does c have circular shift operators?

1302


Linked lists -- can you tell me how to check whether a linked list is circular?

1133


Explain union. What are its advantages?

1127


Is there anything like an ifdef for typedefs?

1223


What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.

4337


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

1203


What is 2c dna?

1131


What is the purpose of the statement: strcat (S2, S1)?

1223


What is the significance of c program algorithms?

1196


What is extern variable in c with example?

1056


What is the benefit of using #define to declare a constant?

1151


What does stand for?

1143