Quindi, così è giusto ?
codice:
#include <stdio.h>
#include <stdlib.h>
int main ()
{
char Nome [2] [10];
char Cognome [2] [10];
char Telefono [2] [10];
int Count = 0;
int i;
FILE *Stream = fopen ("Contatti.txt", "r");
if (Stream == NULL)
{
printf ("Errore nell'apertura del file");
}
else
{
while(!feof (Stream))
{
fscanf(Stream, "%s %s %s", Nome [Count], Cognome [Count], Telefono [Count]);
Count++;
}
}
for (i = 0 ; i < 10 ; i++)
{
printf ("%s %s %s\n", Nome [i], Cognome [i], Telefono [i]);
}
fclose (Stream);
system ("PAUSE");
}