I want the program to read a text file with 20 separate characters that are on separate lines. I want these characters to be matched with the programmed letters in the program, where they will display incorrect, and complete incorrect. I have successfully built a program in which I can manually enter letters and will do what I wanted, but my knowledge about using files in code is limited. I read about vectors, but first I would like it to be simple and succeed before I try to learn something else. I tried to create some kind of code similar to what, in my opinion, should look like.
Now I do not get any errors ... How to get text from a file to a program? I have built some code that almost does this, but cannot determine the last steps to connect it. Is it possible for someone to help me steer me in the right direction. Thanks in advance. With this forum, I am learning much more than I ever thought.
#include <iostream>
A text file is just a notepad text file with the name "key" with the following:
C D A A C A D C C D B C D A D C A A D A
source share