I'm tryin to read text from an input file on letter at a time in strings. The text is formatted like this

D 5
A 9
and so on. I made my while loop and everything but when I run the program after the user inputs the input filename the program stalls and the cursor just blinks. I can type stuff in but the program doesn't exit. Anyone have any suggestions.