Perguntas com a marcação «feof»

5
Por que "while (! Feof (file))" sempre está errado?
Ultimamente, tenho visto pessoas tentando ler arquivos como esse em várias postagens: #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { char *path = "stdin"; FILE *fp = argc > 1 ? fopen(path=argv[1], "r") : stdin; if( fp == NULL ) { perror(path); return EXIT_FAILURE; } while( !feof(fp) ) …
573 c  file  while-loop  eof  feof 
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.