I'm working an an assignment for C++, and I've almost got it figured out--except for one little glitch. When I run the program, the prompt I am giving the user before I collect their data, shows up twice in row. Here's the part of the code I'm referring to:
//... blah blah blah, this is a bunch of other code that works fine...
//states phrase instructions for character
void phraseInstructions()
{
string instructions;
instructions =
"\nPlease enter a phrase or sentence >= 4 characters: \n";
cout << instructions;
}
//get theString from user
string getString()
{
string theString;
//while the phrase is less than or equal to four characters in length, keep user in the loop
cin >> theString;
while (theString.length() <=4)
{
phraseInstructions();
cin >> theString;
}
return theString;
}