ExamVeda
Login
Home
This question belongs to C Program Arrays And Strings
Arrays and Strings
?

Which of the following function is used to find the first occurrence of a given string in another string?

Answer & Solution
Correct Answer: Option C

The function strstr() Finds the first occurrence of a substring in another string
Declaration: char *strstr(const char *s1, const char *s2);

Return Value:
On success, strstr returns a pointer to the element in s1 where s2 begins (points to s2 in s1).
On error (if s2 does not occur in s1), strstr returns null.

Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Dhruba Jyoti
Dhruba Jyoti 3 years ago
Which of the following functions is used to find the position of the particular substring within a string?



Answer choices
Select only one option
FIND

SEARCH

FINDALL