1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
int main( void )
{
char *definitions[100];
...
lireGroupe(nomFichierGroupe, definitions);
printf("%s \n", definitions[0]);
printf("%s \n", definitions[1]);
printf("%s \n", definitions[2]);
printf("%s \n", definitions[3]);
return 0;
}
void lireGroupe(char *nomFichier, char *tabDef[])
{
char lecture;
char tempIdGroupe;
char chaine[100] = "";
int i = 0;
...
tempIdGroupe = chaine[0];
fgets(chaine, 100, fichierGroupe);
while( chaine[0] != '}')
{
tabDef[i] = chaine;
printf("%s", tabDef[i]);
i++;
fgets(chaine, 100, fichierGroupe);
}
...
return;
} |
Partager