Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- int main(){
- FILE * texto;
- texto = fopen("linhas.txt","r");
- char str[500];
- int num=0;
- if(texto == NULL){
- printf("Erro, nao foi possivel abrir o arquivo\n");
- }
- else{
- while(!feof(texto)){
- printf("%d - ",num+1);
- fgets(str,300,texto);
- printf("%s",str);
- num++;
- }
- fclose(texto);
- system("PAUSE");
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement