Excuse me, I have a problem in my code when I try to compile it, and I don't understand what's the error to solve:
"6:26:error:requestformember‘txt’in something not a structure or union"
fichero = fopen(fichero.txt,"r");
Can anyone help me please
I leave you my code:
#include <stdio.h>
int calcular(char nombre[]){
FILE *fichero; int contar, maximo = 0;
char caracter;
fichero = fopen(fichero.txt,"r");
if(fichero == NULL)
printf("ERROR de Apertura");
else{
while(!feof(fichero)){
fscanf(fichero, "%c", & caracter);
if(caracter == '/n'){
if(contar > maximo)
maximo = contar;
contar = 0;
fclose(fichero);
fclose(salida);
}
}
contar++;
}
return(linea);
}
Aucun commentaire:
Enregistrer un commentaire