I am very new to programming, and have been trying to figure out this problem for over an hour now. Can some one help me figure out what is wrong with my code?
This is a simple version of a funtion I am working on.
I want it to print "Unscramble the word: rnaooagk." Then check the players response against the answer.
The code compiles fine. But when I run it, nothing is printed to the screen.
My other question is:
Is it possible to setup my funtion with values for 2 strings?
(ex.)
string question(string word, string answer);
-This is my first time posting a quesion. I hope I made my problem clear.-
---------------------------------
Code:
#include
#include
using namespace std;
string reply;
string answer = "kangaroo";
string word;
string question(string word);
int main()
{
string question("rnaooagk");
cin.get();
}
string question(string word)
{
do
{
cout << "Unscramble the word: " << word;
cin >> reply;
} while (reply != answer);
return reply;
}