Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <fcntl.h>
  4.  
  5. int main(int argc, char* argv[]) {
  6.  
  7. int i, f;
  8. char string[10];
  9.  
  10. close(0);
  11.  
  12. for (i = 1 ; i < argc ; i++) {
  13.  
  14. f = open(argv[i], O_RDONLY);
  15.  
  16. if (f < 0)
  17. continue;
  18.  
  19. scanf("%s", string);
  20. printf("%s\n", string);
  21. close(f);
  22.  
  23. }
  24.  
  25. return 0;
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement