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

Answers were Sorted based on User's Feedback



Tell about strtok & strstr functions..

Answer / 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

Tell about strtok & strstr functions..

Answer / shruti

The above answer is perfect...

Kudos..
well done..

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More C Interview Questions

Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

0 Answers  


I need previous papers of CSC.......plz help out by posting them.......

0 Answers  


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

0 Answers  


Can two or more operators such as and be combined in a single line of program code?

0 Answers  


Why doesnt this code work?

0 Answers  


n=7623 { temp=n/10; result=temp*10+ result; n=n/10 }

7 Answers   Wipro,


Explain how do you generate random numbers in c?

0 Answers  


write a program to print data of 5 five students with structures?

0 Answers  


what will be the output of "printf("%d%d",scanf("%d% d",&a,&b))".provide an explation regarding the question

6 Answers  


N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3

3 Answers   Honeywell,


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

0 Answers   GrapeCity,


What are preprocessor directives?

1 Answers  


Categories