Reading stdin from stdout of another application

Discussion in 'C++' started by Lisa C, Aug 1, 2003.

  1. Lisa C

    Lisa C Guest

    Hi all. I am trying to set up a C++ program which will continuously
    read stdin from another applications stdout. I will continue reading
    until I read a message that will indicate to stop. Does anyone have
    any ideas on how I can do this?

    Thanks for responses.
    Lisa C, Aug 1, 2003
    #1
    1. Advertising

  2. On 1/8/03 6:51 pm (UK time), Lisa C let loose these words:

    > Hi all. I am trying to set up a C++ program which will continuously
    > read stdin from another applications stdout. I will continue reading
    > until I read a message that will indicate to stop. Does anyone have
    > any ideas on how I can do this?


    AFAIK, only the OS can control where stdin comes from.

    In MS-DOS or Unix (don't know about other platforms), use a pipe

    qwert | yuiop

    will run qwert, the stdout of which becomes the stdin of yuiop.

    Stewart.

    --
    My e-mail is valid but not my primary mailbox. Please keep replies on
    on the 'group where everyone may benefit.
    Stewart Gordon, Aug 1, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fernando Arbeiza

    Will reading from stdin() flush output to stdout()?

    Fernando Arbeiza, Feb 4, 2004, in forum: C Programming
    Replies:
    3
    Views:
    616
    Fernando Arbeiza
    Feb 5, 2004
  2. Johnathan Doe

    peek at stdin, flush stdin

    Johnathan Doe, May 15, 2004, in forum: C Programming
    Replies:
    5
    Views:
    24,850
    Chatoyer
    May 17, 2013
  3. Charlie Zender

    Reading stdin once confuses second stdin read

    Charlie Zender, Jun 19, 2004, in forum: C Programming
    Replies:
    6
    Views:
    772
    Dan Pop
    Jun 21, 2004
  4. Andreas Persson
    Replies:
    2
    Views:
    300
    Andreas Persson
    Mar 3, 2004
  5. Stefano Sabatini
    Replies:
    6
    Views:
    286
    Stefano Sabatini
    Jul 29, 2007
Loading...

Share This Page