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 |
print out put like this form 1 2 3 4 5 6 3 5 7 9 11 8 12 16 20
What is modifier & how many types of modifiers available in c?
what is the code for getting the output as * ** ***
who is the founder of c
19 Answers College School Exams Tests, HP,
What is a newline escape sequence?
Why do we use return in c?
Why we not create function inside function.
Explain what is the difference between far and near ?
What is the size of enum in c?
How can you be sure that a program follows the ANSI C standard?
Can true be a variable name in c?
What is the package for freshers(Non IIT) in amazon(hyderabad). And what is the same for those who are a contract employee.