Bon voila je n'arrive pas a acceder a mes variables situées dans une strucuture qui elle serait dans un tableau situes dans un structure ... hehe :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
#include <stdio.h>
 
typedef struct 
{
	int num;
	char *libelle;
	int coef;
}Matiere;
 
typedef struct 
{
	int nbMatiere;
	Matiere t[];
}Tabmatiere;
 
int main()
{
	Tabmatiere tabMat;
	//Matiere mat;
	int i;
	printf("yop\n");
	for (i=0; i<3;i++)
	{
	printf("saisi :\n");
	scanf("%s\n",tabMat.t[i].libelle);
	}
	printf("La matiere traitant de la %s . \n", tabMat.t[0].libelle);
	printf("La matiere traitant de la %s . \n", tabMat.t[1].libelle);
	return (0);
}
Vous comprenez mieux la ?
J'ai code ce truc pour montrer mon probleme.
Ca compile ms le .exe marche pas.
De maniere general j'aimerai connaitre la syntaxe pour acceder a un tablaeu de structure lui meme situe ds un strucuture, le tout etant defini en typedef.

printf("... %s"tabMat.t[0].*libelle);??
printf("... %s"*tabMat.t[0].libelle);??
printf("... %s"tabMat.t[0].&libelle);??
printf("... %s"&tabMat.t[0].libelle);??
scanf("%s",tabMat.[0].*libelle);??
scanf("%s",*tabMat.t[0].libelle);??
scanf("%s,"tabMat.t[0].&libelle);??
scanf("%s",&tabMat.t[0].libelle);??
lequel est bon?
LE rpobleme serait ds les declarations????
Merci de meclairer.