作者:arliejun | 来源:互联网 | 2023-05-16 20:18
I have the command
我有命令
echo {1..50..2} | ./assn3
and it prints out
它打印出来
The sum of 25 numbers is 625
This is in C and I don't know how ./assn3
reads in what has come from the pipe. Is this in stdin
and I use read()
or should I be using something else? I am just confused on where the echo goes for assn3
to read it from?
这是在C中,我不知道./assn3如何读取管道中的内容。这是在stdin中我使用read()还是我应该使用其他东西?我只是对于回声从何处读取它而感到困惑?
2 个解决方案