Checking to see if the input has all of the compare line
Here's the source, how can I use the same functions and everything to check for the entire line of the compare instead of just one word. Also, how can I get it to have one word files... This is getting really crapped up.
-This is where the string search problem is, I don't know what's wrong with the crapped up part, I think their all involved.
Code:
void cortana::find_line()
{
linenumber=0;
ifstream check_in("compare.txt");
while(linenumber!=40)
{
getline(check_in,str,'\n');
str=lower(str);
if(strstr(str.c_str(),input.c_str()))
{
line=linenumber;
prep=true;
cortana::find_responce();
break;
}
else if(str=="")
{
prep=false;
cortana::find_responce();
break;
}
else if(input!=str)
{
linenumber++;
}
}
check_in.close();
}
void cortana::find_responce()
{
cout << line;
getch();
linenumber=0;
ifstream check_out("responce.txt");
if(prep==true)
{
while(linenumber!=line+1)
{
getline(check_out,str,'\n');
if(linenumber==line)
{
responce=str;
break;
}
else
{
linenumber++;
}
}
}
else if(prep==false)
{
responce="I don't understand.";
}
check_out.close();
}