daily pastebin goal
8%
SHARE
TWEET

Leitura simples 3

a guest Oct 20th, 2012 3 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.         FILE* p_arquivo = NULL;
  7.         char letra;
  8.  
  9.         //abre o arquivo
  10.         p_arquivo = fopen("MD5SUMS", "r");
  11.  
  12.         if (p_arquivo == NULL)
  13.         {
  14.                 printf("Erro na abertura do arquivo\n");
  15.                 exit(1);
  16.         }
  17.  
  18.         while ( feof(p_arquivo) == 0 ) {
  19.                 letra = fgetc(p_arquivo);
  20.                 if (feof(p_arquivo))
  21.                         break;
  22.  
  23.                 printf("%c", letra);
  24.         }
  25.  
  26.         //fecha o arquivo
  27.         fclose(p_arquivo);
  28.         return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top