Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.03 KB | None | 0 0
  1. #include <sys/time.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <math.h>
  5. #include <string.h>
  6. #include "tad.h"
  7.  
  8.  
  9. int main()
  10. {
  11.     FILE *Arquivo;
  12.     char arquivo_aux;
  13.     TipoLista Lista;
  14.     TipoPalavra exemplo;
  15.     int Frase;
  16.     int Paragrafo;
  17.    
  18.     char caracter[2];
  19.     caracter[1] = '\0';
  20.    
  21.     FLVazia(&Lista);
  22.    
  23.     char palavra[1000] = "";    
  24.    
  25.     if((Arquivo = fopen("texto.txt","r")) == NULL)
  26.     {
  27.         printf("O arquivo nao pode ser aberto");
  28.         getch();
  29.     }
  30.     else
  31.     {
  32.         arquivo_aux = fscanf(Arquivo, "%c", &caracter[0]);
  33.        
  34.         //while(arquivo_aux != EOF)
  35.         //{
  36.             while(caracter[0] != '.')
  37.             {
  38.                 strcat(palavra,caracter);
  39.                
  40.                 arquivo_aux = fscanf(Arquivo, "%c", &caracter[0]);
  41.                                
  42.                 printf("\n\n%s", palavra);
  43.                
  44.                 if(caracter[0] == '.')
  45.                 {/*
  46.                     printf("\n\nSTOP");
  47.                     strcpy(exemplo.p , palavra);
  48.                     exemplo.quantidade = 1;
  49.  
  50.                     Insere(exemplo, &Lista);*/
  51.                     printf("\nCabou");
  52.                 }
  53.            
  54.             }
  55.         //}    
  56.     }
  57.    
  58.     printf("\n\n");
  59.     //ImprimeLista(Lista);
  60.    
  61.     fclose(Arquivo);
  62.    
  63.     return 0;
  64.    
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement