1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| struct Bibliotheque_noeud * lire(struct Bibliotheque_noeud *bibliotheque){
//initialisation compteur pour boucle lecture de mots cles
int i;
//init variable contenant les donnees de livre
struct Livre *nouveau;
nouveau = (struct Livre *) malloc(sizeof(struct Livre));
printf("Inserer code :\n");
scanf("%d", &nouveau->code);
printf("Inserer auteur :\n");
rewind(stdin);
fgets(nouveau->auteur, 20, stdin);
printf("Inserer titolo :\n");
rewind(stdin);
fgets(nouveau->titre, 20, stdin);
for (i = 0; i < 5; i++)
{
printf("Inserisci il %d parole chiave :", i+1);
scanf("%s", nouveau->motsCle[i]);
} |
Partager