problème chaine de structure
Lut!
Soit :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| struct Livre{
int code;
char auteur[20];
char titre[20];
mot motsCle[5];
};
struct Bibliotheque_noeud {
struct Livre *livre; //pointeur vers donnees livre
struct Bibliotheque_noeud *livreSuivant; //pointeur vers livre suivant
};
struct Bibliotheque_noeud * lire(struct Bibliotheque_noeud *bibliotheque);
int main(void){
..
.
..
bibliotheque=lire(bibliotheque);
..
..
..
return 0;
};
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 de livre :");
scanf("%d", &(nouveau->code));
printf("Inserer nom d'auteur:");
scanf("%s", nouveau->auteur);
printf("Inserer le titre :");
scanf("%s", nouveau->titre); |
comment lire chiane de caractaire avec des espace ???!!