Ok, I'm making a chatter bot (I know, tall order, but I think I can make a simple one) and this is what I have so far:
Code:
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
char One[50], Two[50], Three[50];
cout<<"//-- Hello, my name is Deep Blues.\n>> ";
cin.getline ( One, 50 );
if(One == "My name" || One == "my name") {
cout<<"//-- Nice name.\n>>";
cin.getline ( Two, 50 );
cout<<"//-- Ok then "<< One <<", What do you want to talk about?\n>> ";
cin.getline ( Three, 50);
} else {
cout<<"//-- What is your name?\n>> ";
cin.getline ( Two, 50 );
cout<<"//-- Ok then "<< Two <<", What do you want to talk about?\n>> ";
cin.getline ( Three, 50);
}
}
How can I make it so the text in the if statement looks for the text "my name" in the string. Like the find function in notepad but only for the specific string?