MCQ Answer

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

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

Topic : Arrays

A. strchr( )

B. strrchr( )

C. strstr( )

D. strnset( )




Correct Answer is :

C. strstr( )



Explanation
strstr is a C standard library string function as defined in string.h. strstr() has the function signature char * strstr(const char *haystack, const char *needle); which returns a pointer to a character at the first index where needle is in haystack, or NULL if not present.
CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz