strstr( ) function in C is basically used in C program to find substring in given string.
Through this article we will try to cover whole basis queries about strstr( ) in detail so if you have any doubt related to this topic then you will be go with this article....
Topics:-
- strstr( ) function in c
- strstr( ) function in c example
- strstr( ) function in c syntax
- header file for strstr( ) function in c
- what does strstr( ) return ?
strstr( ) function in C
strstr( ) function is also known as a built in function or standard library function of C but it is widely know as string function. strstr( ) function is used to presence of substring in another in string.
Header file for strstr( ) function in C
strstr( ) function is a built in function of C and it is define in <string.h> header file.
Return Value of strstr( ) function in C
If the substring is not present in another string then strstr( ) function return NULL value.
Syntax of strstr( ) function in C
char *strstr(const char *arr1 , const char *arr2);
Example of strstr( ) function in C
#include<stdio.h>
#include<string.h>
int main()
{
char n;
char str[15]="AceinStudy";
char str1[15]="Ace";
n=strstr(str,str1);
if(n)
printf("str1 is present in str");
else
printf("str1 is Not present in str");
return 0;
}
____________________________________
____________________________________Conclusion:
strstr( ) function in C is basically used in C program to find substring in given string.

