I am trying to make a program that will read data in from a text file using input redirection, and then display a menu which will take input from the user using the keyboard. The issue is that stdin is set to read from the file and will not allow the user to use the keyboard. Does anyone know how to change the input source from the file to the keyboard in the code? I am using C
-
Do you redirect the input streams programatically, or is the program started with redirected streams?lethal-guitar– lethal-guitar2014-03-06 14:54:18 +00:00Commented Mar 6, 2014 at 14:54
-
The program is started with redirected streams i.e. ./a.out < input.txt. Also if I was to use freopen, which parameters would redirect the input to the keyboard?QuinnFTW– QuinnFTW2014-03-06 19:31:56 +00:00Commented Mar 6, 2014 at 19:31
Add a comment
|