我在网上搜索了这个主题并发现了这个解释,但我无法理解它背后的想法。代码及解释如下..
#include <unistd.h>
...
int pfd;
...
close(1);
dup(pfd);
close(pfd); //** LINE F **//
...
/*The example above closes standard output for the current
processes,re-assigns standard output to go to the file referenced by pfd,
and closes the original file descriptor to clean up.*/
Run Code Online (Sandbox Code Playgroud)
F线是做什么的?为什么它至关重要?