Guest User

Untitled

a guest
May 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. int main(int argc, char **argv)
  5. {
  6. if (argc != 4)
  7. {
  8. exit(1);
  9. }
  10. ///argv program klucz wejscie wyjscie
  11. FILE *wejscie;
  12. FILE *wyjscie;
  13. if ((wejscie = fopen(argv[2],"r")) != NULL)
  14. {
  15. wyjscie = fopen(argv[3],"w");
  16. int lenWejscie = 0;
  17. int lenKlucz = 0;
  18. char a;
  19. while (argv[1][lenKlucz] != '\0')
  20. {
  21. ++lenKlucz;
  22. }
  23. while((a = fgetc(wejscie))!= EOF)
  24. {
  25. printf("%c %d",a,a);
  26. }
  27.  
  28.  
  29. }
  30. fclose(wejscie);
  31. fclose(wyjscie);
  32.  
  33.  
  34.  
  35. }
Add Comment
Please, Sign In to add comment