摘要:
dup() 如何把标志输入(stdin)重定向到一个文件,或者把标志输出(stdout)重定向到一个网络连接(sockfd)? 可以用系统调用dup或dup2。 #include <unistd.h> int dup(int oldfd); int dup2(int oldfd, int newfd 阅读全文
摘要:
std::swap std::swap 用于交换2个元素,g++源码如下 /** * @brief Swaps two values. * @param __a A thing of arbitrary type. * @param __b Another thing of arbitrary ty 阅读全文