Hello, I'm rather new at C++ and I was wondering if you guys could help me out with something I'm trying to do. What I want to do is make it so when I type something like "apple" the cmd comes back and picks a random word that I supply it to say.
Also how could I make it so I can keep typing words in after I get one answer, I want to be able to just keep telling it words without the CMD going "Press any key to continue" and exiting out. Thanks for any help! This is the only code I have so far:
Code:
// Random Words
#include <iostream>
#include <cmath>
void myfun (int);
int main ()
{
using namespace std;
cout << endl;
cout << endl;
cout << "You: ";
int userinput;
cin >> userinput;
myfun(userinput);
system("pause");
return 0;
}
void myfun(int x)
{
using namespace std;
cout << endl;
cout << "Your Computer: apple" << endl;
cout << endl;
}