Standard input and output (using C programs)

1

I have a program that prints something, and another that reads something and prints another, I would like to know if it has how to connect the output of one with the input of another.

The problem I made was to pass the output from one to txt , and then I asked the other to read this txt , as follows:

 ./teste > texto.txt; ./1024 < texto.txt

Can you do it directly? For example:

./teste > ./1024 (dessa maneira não funciona)
    
asked by anonymous 02.11.2016 / 01:52

1 answer

1

Use the pipe (|) operator. It does just what you need: it takes the output from one program and uses it as input from another:

./teste | ./1024
    
03.11.2016 / 13:05