SHOW:
|
|
- or go back to the newest paste.
1 | - | char tab[nb_player][15]; |
1 | + | int nb_player=0; |
2 | int i=1; | |
3 | player *tab=NULL; | |
4 | printf("Combien y a t il de joueur "); | |
5 | scanf("%d",&nb_player); | |
6 | tab=malloc(sizeof(player)*nb_player); | |
7 | ||
8 | for(;i<=nb_player;i++) | |
9 | - | tab[i-1]=tempNom; |
9 | + | |
10 | player joueur; | |
11 | char tempNom[15] = ""; | |
12 | printf("Nom du joueur %d ",i); | |
13 | fgets(tempNom, sizeof(tempNom), stdin); | |
14 | joueur.nom=tempNom; | |
15 | clean(tempNom, stdin); | |
16 | ||
17 | tab[i-1]=joueur; | |
18 | ||
19 | ||
20 | } |