Ragazzi sto impazzendo,ho un problema con un esercizio di Reti,il codice è il seguente
codice:
sscanf(buff,"%s %s" ,nomefile,nome);
if((nomefile==0) && (nome==0))fputs("Errore sscanf",stdout); fd1=fopen(nomefile,"r");
if(fd1==NULL)fputs("Errore apertura file",stdout);
for(; ;){
riga=fgets(righe,MAXLINE,fd1);
sscanf(buff,"%s %d",stringa,&numero);
if(riga==NULL)break;
if(nome==stringa){
sprintf(num,"%d", numero);
break;
}
}
fclose(fd1);
Mi da un warning nella fopen ,come se il risultato della sscanf non fosse il file che gl'ho passato in buff:
warning: passing argument 1 of ‘fopen’ makes pointer from integer without a cast
Mi dite dov'è che sbaglio???
Grazie.