This is a simple question, but I don't use C often. I have a program which takes data from an input file, but I need to use C input funtions. I can either 1) redirect input at the command line (a.out < data.txt) or 2) have the user specity an input file at runtime.

I am currently using the first option, but my problem is that I use getch() to accept keyboard input later in the program. I do not know how to "unredirect" the input from the data file to the keyboard. I would actually like to use the 2nd option, but the only method I know to take input from a file is ifstream. I CANNOT use that. Can somebody help me out here?