I made a touch typing console program in C++. It reads the text from a file and load it to the screen. User must enter the right letter in order for him to proceed to the next letter. My only Problem is with the '\n', so if I had something like this in the text file (the file I'm reading from):
"
hello
dude
Sup
"
After the user enters "hello", he should press enter right? But whenever he presses enter, getch() takes him back to the beginning for the current line.
How can I fix this?
I'm reading the whole file and storing it to a string, like this:
void getTextFromFile()
{
text.assign(istreambuf_iterator<char>(fin), istreambuf_iterator<char>());
}