Tell about strtok & strstr functions
Answers were Sorted based on User's Feedback
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 |
Where are local variables stored in c?
What is n in c?
Which programming language is best for getting job 2020?
why in C,C++'s int size is 2 byte and .net(c#) int Size is 4 byte?
yogesh patil in dell
Why is C called a middle-level language?
How pointers are declared?
being a chemical engineer and with an aggregate of 80% why you opt for TCS and not your core industry?
What is realloc in c?
Explain why c is faster than c++?
How many ways are there to swap two numbers without using temporary variable? Give the each logic.
Explain what is the purpose of "extern" keyword in a function declaration?