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 |
How do I copy files?
Here is a good puzzle: how do you write a program which produces its own source code as output?
What is malloc and calloc?
What is anagram in c?
What is the ANSI C Standard?
What is output redirection?
write an algorithm and c program to add two 2x2 matrics
What is use of #include in c?
What are the types of functions in c?
What is file in c language?
can any one provide me the notes of data structure for ignou cs-62 paper
What is a program flowchart and how does it help in writing a program?