ok so last time I was here, I was programmin tic-tac-toe and its great. Now I have programmed hangman! :D . Anyways right now its for two players only. So I want it so the computer will choose a random word from a text file and assign that to my string called word. I know it requires ifstream but cant get it to work. If someone could write out the necessary code, that would be great! My txt file is called "hangtext.txt."
Looking at my actual hangman code is not necessary. All you have to know is that a random word needs to be selected from a text file (one word per line in the txt file, in case that affects anything), and set equal to my string word. I am much appreciative. thanks!