Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. {
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement