I am trying to write a program where 2 stings are input. The program should check whether second string is part of the first string. For example, if the first string is "there" and second is "here", program should report that second string is part of first. I am having difficulty in figuring out how to do this. Can any one help. I will really appreciate it a lot. This is what I have:

#include <iostream.h>
#include <conio.h>
#include <string.h>
#include <stdio.h>


int find(char[], char[]);

void main()
{
clrscr();
int status;
char firstString[20];
char secondString[20];
cout << "Enter first word: ";
cin >> firstString;
cout << "Enter second word: ";
cin >> secondString;
status = find (firstString, secondString);
if (status == 1)
cout << "First string includes second string.";
else
cout << "First string does not include second string.";
getch();

}

int find (char first[], char second[])
{
int lengthOne = 0, lengthTwo = 0;
int i = 0, flag = 1;

while (first[i] != '\0') {
lengthOne++;
i++;
}

int j =0;
while (second[j] != '\0') {
lengthTwo++;
j++;
}

for (int x = 0; x < lengthOne; x++) {
for (int y = x; y < lengthTwo; y++)
{

if (second[y] != first [y])
{ flag = 0;
break;
}
}

}

if (flag == 1)

return 1;

return 0;

}