No, that's not the way to do it. No idea if it would work, but wouldn't it be a lot easier to just open the file, read it and reserve stdin for your interaction with the user?
FILE *yourinputfile;
yourinputfile=fopen("whatevernamethefilehas","r");
// read with the appropriate routines, eg fscanf
fclose (yourinputfile);
char answer; answer = getchar(); // won't skip now
You'll notice that all input routines in C have a "shorthand" variety that reads stdin, and a variety that starts with f
that will read a file
- scanf and fscanf
- gets and fgets
- etc
The man pages are your friend :)