Reading stdin from stdout of another application

L

Lisa C

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

Stewart Gordon

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.
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top