PDA

View Full Version : [SOLVED] Inter program communication , standard input output



jit.sd
October 27th, 2008, 05:27 PM
Hey ,

Is there a way for two programs to communicate using standard input/output . for example if i am running two c++ programs and one program generates the input for the other program . What are the different ways they could communicate ? If program1 were to write something to standard output is it possible for program2 to read that ?

I dont know the keyword to search for , and thus am pretty stuck .

Can someone help out ?

Thanks ,
Jit

geirha
October 27th, 2008, 05:40 PM
Start them like this:
./prog1 | ./prog2 Both programs will be run at the same time, and the output of prog1 is connected to the input of prog2

jit.sd
October 27th, 2008, 07:20 PM
Brilliant , it works perfectly .

thank you so much :)