3. The function getWord, takes two parameters, the string array, and a character array (cstring) . It chooses one word randomly from the string array and fills the character array with that string. Note: If you have a string, str, then str.c_str() will return a cstring. So you can use the function strcpy to copy.
4. The function setupGuess takes two cstring parameters. The first parameter is the word that was chosen from function 3 (we will call this the true word). The function sets up the second parameter so that it is the same length as the first parameter, with the character'-' in each spot (we will call this the guessed word).
5. The function tryguess takes the true word, the guessed word, and an integer that represents the number of missed guesses. It prompts the user for a letter (character). If the character is in the word, then the proper spot is filled. If the character is not in the word then number of missed guesses is incremented. If you wish you can have this function return true if the word has been totally guessed and false otherwise.
You can make a data file for 100 words by going to http://www.mieliestronk.com/wordlist.html and download the file, and choose 100 words from the file.
MAIN CODE: