/* ************************************************************************ * Filename: 02_dup.c * Description: * Version: 1.0 * Created: 2011年04月14日 20时47分52秒 * Revision: none * Compiler: gcc * Author: wenhao (wh), hnrain1004@gmail.com * Company: sunplusapp * ************************************************************************/ #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { int fd; char str[]="hello world/n"; fd = dup(fileno(stdout)); write(fd,str,strlen(str)); return 0; }
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
psql窗口函数 ROW_NUMBER的应用
psql窗口函数的使用
窗口函数 一对多 表结构 -
python接twitch,wx,b站的简单应用
简单介绍最近写的机器人
Bot 微信 Twitch b站 -
1651_MIT 6.828 dup函数的简单梳理
如果这是值得关注的,那么除非程序是单线程的,并且不在信号处理程序中分配文
linux unix 服务器 JOS MIT -
TCP与DUP简单对比
TCP与DUP简单对比
tcp通信 -
linux系统下dup和dup2函数解析
----今天接着昨天的话题讲,在昨天的文章里面,我们讲到了文件共享有三种实现方式,其中一种实现方式就是我们今
#include 文件描述符 linux -
dup,dup2函数【转】描述符 文件描述符 标准输出 重定向 #include