Guest User

Untitled

a guest
Jan 14th, 2020
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     FILE* fin = NULL;
  6.     if ((fin = fopen("plik.txt", "rt")) == NULL)
  7.     {
  8.         perror("ERROR open input file \n");
  9.         return 1;
  10.     }
  11.     FILE* fout = fopen("wynik.txt", "w");
  12.     if (fout == NULL)
  13.     {
  14.         fclose(fin);
  15.         perror("ERROR open output file \n");
  16.         return 2;
  17.     }
  18.  
  19.     while (!feof(fin))
  20.     {
  21.         char c = fgetc(fin);
  22.         if ((c >= 'a') && (c <= 'z'))
  23.             c -= 0x20;
  24.         if(!feof(fin))
  25.             fputc( c, fout );
  26.     }
  27.  
  28.  
  29.     fclose(fin);
  30.     fclose(fout);
  31.     printf("Done: \n");
  32.     return 0;
  33. }
  34.  
  35.  
  36. // ----------------------------------------------------------------------WSKAZNIKI----------------------------------------------------------------------------------------
  37. // T x; zmienna typu T, np int x;
  38. // T* p; zmienna, wskaznik do komorki pamieci typu T(Adres) np int* -p;
RAW Paste Data