You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.0 KiB

#include "prototype.h"
Liste listenouv(void)
{
return NULL;
}
bool vide(Liste l)
{
return l==NULL;
}
Liste inserer(Liste l, Candidat can)
{
Maillon *m;
m=(Maillon*)malloc(sizeof(Maillon));
if (vide(m))
{
printf("Pb malloc\n");
exit(1);
}
m->c=&can;
m->suiv=l;
m->h=m->h+1;
return m;
}
void affichageT(Liste l)
/*affiche la liste de tous les candidats*/
{
printf("Numéro \tPrénom \tNom\n");
affichage1(*l->c);
}
void affichage1(Candidat c)
/*affiche les informations d'un candidat*/
{
printf("%d \t%s\n", c.numC, c.prenom);
}
Liste inscription(Liste lCand, int nbInsc)
/* inscript un candidat en rentrant toutes ses informations*/
{
Candidat c;
printf("Veuillez rentrer votre prénom : ");
scanf("%s", c.prenom);
printf("%s\n", c.prenom);
printf("Veuillez rentrer votre nom : ");
scanf("%s", c.nom);
printf("%s\n", c.nom);
c.nbChoix=0;
c.lChoix=NULL;
c.numC=nbInsc + 1;
lCand=inserer(lCand, c);
return lCand;
}