Programmer en langage C
260
© Éditions Eyrolles
void creation (s_point * * adeb)
{
int num ;
float x, y ;
s_point * courant ;
* adeb = NULL ;
while ( printf("numéro x y : "),
scanf ("%d %f %f", &num, &x, &y), num)
{ courant = (s_point *) malloc (sizeof(s_point)) ;
courant -> num
= num ;
courant -> x
= x ;
courant -> y
= y ;
courant -> suivant = * adeb ;
* adeb = courant ;
}
}
void liste (s_point * debut)
{
printf (" **** liste de la structure ****\n") ;
while (debut)
{ printf ("%d %f %f\n", (debut)->num, (debut)->x, (debut)->y) ;
debut = (debut)->suivant ;
}
}
Delannoy Livre.book Page 260 Mercredi, 6. mai 2009 4:27 16
260
© Éditions Eyrolles
void creation (s_point * * adeb)
{
int num ;
float x, y ;
s_point * courant ;
* adeb = NULL ;
while ( printf("numéro x y : "),
scanf ("%d %f %f", &num, &x, &y), num)
{ courant = (s_point *) malloc (sizeof(s_point)) ;
courant -> num
= num ;
courant -> x
= x ;
courant -> y
= y ;
courant -> suivant = * adeb ;
* adeb = courant ;
}
}
void liste (s_point * debut)
{
printf (" **** liste de la structure ****\n") ;
while (debut)
{ printf ("%d %f %f\n", (debut)->num, (debut)->x, (debut)->y) ;
debut = (debut)->suivant ;
}
}
Delannoy Livre.book Page 260 Mercredi, 6. mai 2009 4:27 16
