strstr in c

strstr function checks the sub string in the actual string. If the substring is found in the string it returns the address of the (sub)string ,else returns a null.

syntax:

strstr (string, substring);
#include
#include
main()
{
char *i;
char x[20],y[20];
printf("enetr string 1");
gets(x);
printf("enetr string 2");
gets(y);
i=strstr(x,y);
if(i==NULL)
printf("sub string not found");
else
printf("sub string found at %d",i-x+1);
}