first my task was to write this program that checks that string t contained in string s or not and i successfully made it and now i have to change this program a little bit and now i have to use a bool function in this program any one can tell me that how i will do that. thank you in advance. please help me
#include <iostream>
#include <string>
using namespace std;
void find(char str1[], char str2[])
{
/* Perform the search. */
char *ptr;
ptr = strstr(str1, str2);
if ( ptr == NULL )
{
cout << str1 << " not contained in " << str2 << endl;
cout << "Again compairing the after removing the "
<< "first character of string 2:" << endl;
find(str1, str2+1);
}
else
cout << str2 << " contained in " << str1;
}
int main()
{
char *ptr, str1[80], str2[80];
cout << "Enter the string to be searched: ";
cin >> str1;
cout << "Enter the target string: ";
cin >> str2;
find(str1, str2);
return 0;
}