第一个c语言程序

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>

int main (int argc,char *argv[])
{
        int fd1,fd2;
        fd1 = open(argv[1],O_RDONLY);
        fd2 = open(argv[2],O_WRONLY);
        char buf[1024];
        size_t buff;
        buff = read(fd1,buf,sizeof(buf));
        write(fd2,buf,buff);
        close(fd1);
        close(fd2);
        return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_37188256/article/details/80376559