linux下stdin和stdout以及stderr

On  program  startup,  the  integer file descriptors associated with the streams stdin, stdout,  and  stderr  are  0,  1,  and  2,  respectively.   The  preprocessor   symbols STDIN_FILENO,  STDOUT_FILENO,  and  STDERR_FILENO  are  defined  with  these  values in <unistd.h>.  (Applying freopen(3) to one of these streams can change the file  descriptor number associated with the stream.)

sprintf可以制定那个file descriptors,write和read都可以制定。

原文地址:https://www.cnblogs.com/GODYCA/p/2857701.html