Advertisement
Guest User

Pag22

a guest
Nov 27th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.  
  6.     FILE * pInFile, * pOutFile;
  7.     char ch;
  8.  
  9.     char inF[100], outF[100];
  10.  
  11.     scanf("%s",inF);
  12.     scanf("%s",outF);
  13.  
  14.     pInFile = fopen(inF,"r");
  15.  
  16.     pOutFile = fopen(outF,"w");
  17.  
  18.     if (pInFile == NULL || pOutFile == NULL ) perror("Erro na abertura do arquivo");
  19.     else
  20.     {
  21.         while(1)
  22.         {
  23.             ch = fgetc(pInFile);
  24.             if (ch==EOF) break;
  25.             //printf("%c", ch);
  26.             fputc(toupper(ch),pOutFile);
  27.         }
  28.     }
  29.  
  30.     fclose(pInFile);
  31.     fclose(pOutFile);
  32.  
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement