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 |
Explain union. What are its advantages?
What is true about the following C Functions (a) Need not return any value (b) Should always return an integer (c) Should always return a float (d) Should always return more than one value
What is data structure in c programming?
What is a #include preprocessor?
Write any data structure program (stack implementation)
What does %f mean c?
Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 2. Enter alphanumeric characters and form 2 array alphaets and digits.Also print the count of each array.
write a program to find the frequency of a number
write a program to sum of its digit with using control structure or with out using loop. for ex: let the number is 25634 then answer will be=2+5+6+3+4=20
How can you increase the size of a statically allocated array?
write a program without using main function?
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions