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. Advertisements

  2. 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.
     
    Stewart Gordon, Aug 1, 2003
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.