help needed with redirecting stdin

Alexandre Oliva aoliva@redhat.com
Sat Sep 29 07:50:00 GMT 2001


On Sep 29, 2001, Nauman Akbar <b99094@cs.lums.edu.pk> wrote:

> I am running gcc on Linux and Solaris. At command prompt I am redirecting
> an input file to my binary, which is attached to stdin. I am using
> gets() to read from stdin. After I am finished reading the file, I want
> gets() to continue reading from console input.

freopen("/dev/tty", "r", stdin);

But this is not GCC-specific at all.  Next time you have a generic
programming question, please ask in comp.lang.c or some other C
programming forum.  This mailing list is for help installing GCC, or
using features specific to GCC.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-help mailing list