string - How to make getch() accept taking an enter hit (\n)? -


I have created a Touch Typing Console program in C ++. It reads text from a file and loads it on the screen. The user must enter the correct letter to go to the next letter, with my only problem with '\ n', so if I had something in the text file (I am reading the file):

 < Code> "Hello friend Super"   

After entering the user "Hello", press it right?

How can I fix this?

I am

I am

reading the entire file and storing it in a string like:

  zero getTextFromFile () {text.assign (istreambuf_iterator & lt; char & gt; (fin), istreambuf_iterator & lt; char & gt; ()); }   

First of all, getch () has been deprecated (if you start So there is more problems with just one FYI) I understand that you are trying to accept character input 1 character at a time if you are using getch () to enter '\ n' should be fine. If not, please explain more.

Comments