public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* help needed with redirecting stdin
@ 2001-09-29  5:27 Nauman Akbar
  2001-09-29  7:50 ` Alexandre Oliva
  0 siblings, 1 reply; 2+ messages in thread
From: Nauman Akbar @ 2001-09-29  5:27 UTC (permalink / raw)
  To: gcc-help

Hello

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. But I cant figure out
how? Can anyone help in this regard.

Regards
Nauman

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: help needed with redirecting stdin
  2001-09-29  5:27 help needed with redirecting stdin Nauman Akbar
@ 2001-09-29  7:50 ` Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2001-09-29  7:50 UTC (permalink / raw)
  To: Nauman Akbar; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-29  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-29  5:27 help needed with redirecting stdin Nauman Akbar
2001-09-29  7:50 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).