Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Reading stdin from stdout of another application

Reply
Thread Tools

Reading stdin from stdout of another application

 
 
Lisa C
Guest
Posts: n/a
 
      08-01-2003
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.
 
Reply With Quote
 
 
 
 
Stewart Gordon
Guest
Posts: n/a
 
      08-01-2003
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
peek at stdin, flush stdin Johnathan Doe C Programming 5 3 Days Ago 04:30 PM
Reading from stdin then launching a program that reads from stdin strange behaviour Stefano Sabatini Perl Misc 6 07-29-2007 10:38 PM
Reading stdin once confuses second stdin read Charlie Zender C Programming 6 06-21-2004 01:39 PM
/dev/pts/x, /proc/x/fd, reading stdout, writing stdin, not with open3 Andreas Persson Perl Misc 2 03-03-2004 06:52 PM
Will reading from stdin() flush output to stdout()? Fernando Arbeiza C Programming 3 02-05-2004 04:09 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57