Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.19 KB | None | 0 0
  1. #include<stdio.h>
  2. #include <fcntl.h>
  3. #include <unistd.h>
  4. int main()
  5. {   int fd, c;
  6.    
  7.     fd = open("file", O_WRONLY);
  8.     close(1);
  9.     if (dup(fd) >= 0)
  10.     {
  11.         printf(" hello\n");
  12.         write(1,"world",5);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement