IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 C Discussion :

gestion de bibliothèque


Sujet :

C

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2012
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 33
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2012
    Messages : 5
    Par défaut gestion de bibliothèque
    voulez-vous m'aider a compiler son programme et le faire fonctionner...
    compilateur : Code::blacks 10.05
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
     
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
     
    //Déclaratin:
    //Déclaration : etat de la livre
    typedef struct
    {
        int emprunter;
        int disponible;
        int en_reparation;
    }etats;
     
    //Déclaration :  date
    typedef struct
    {
        int jour;
        int mois;
        int annee;
    }date;
     
    //Déclaration :  livre
    typedef struct
    {
        int code;
        char titre[50];
        char auteur[30];
        date annee_pub;
        etats etat;
    }livres;
     
    //Déclaration : abonnee
    typedef struct
    {
        char nom[30];
        int code;
        livres emprunt;
    }abonnee;
     
    //Déclaration : liste de livre
    //noeud
    typedef struct noeud
    {
        livres valeur;
        struct noeud *next;
    }noeud;
    //liste
    typedef struct
    {
        noeud *tete;
    }liste_livre;
     
    //Déclaration : liste d'abonnée
    //noeud
    typedef struct noeud_1
    {
        abonnee valeur;
        struct noeud_1 *next;
    }noeud_1;
    //liste
    typedef struct
    {
        noeud_1 *tete;
    }liste_abonnee;
     
    //Déclaration bibliothéque
    typedef struct biblio
    {
        liste_livre dispo;
        liste_livre empr;
        liste_livre repar;
        liste_abonnee abon;
    }
     
    ////ajout_livre
    //saisir_livre
    void saisir_livre (livres *l)
    {
        printf("saisir les info de ce livre :\n");
        printf("\n Code :\t");
        scanf("%d",&l->code);
        printf("\n Titre :\t");
        scanf("%s",l->titre);
        printf("\n auteur :\t");
        scanf("%s",l->auteur);
        printf("\n année de publication :\t");
        printf("\n jour :");
        scanf("%d",&l->annee_pub.jour);
        printf("\n mois :");
        scanf("%d",&l->annee_pub.mois);
        printf("\n annee :");
        scanf("%d",&l->annee_pub.annee);
        l->etat.disponible=1;
    }
    //remplir_liste
    void remplir_liste (biblio *b, liste_livre *dispo, livres l)
    { noeud *n,*i;
        n=(noeud*)malloc(sizeof(noeud));
        n->valeur=l;
        n->next=null;
        if (b->dispo->tete==null)
            b->dispo->tete=n;
        else
         {
            i=b->dispo->tete;
            while (i->next!=null)
              i=i->next;
            n->next=i;
         }
    }
    .
    .
    .
    .
    //main
    int main (void)
    { int choix,rd;
      biblio b;
      livres l;
      abonnee a;
     
         void principale()
          pritnf("choix : ");
          scanf("%d",&choix);
          switch(choix)
            {
                case 1: ajout_livre (&b,&l); break;
                case 2: ajout_abonnee (&b,&a); break;
                case 3: emprunt_livre (&b); break;
                case 4: recherche_livre (b,rd); break;
                case 5: affiche_livre (b); break;
                case 6: rendre_livre (&b); break;
                case 7: supprime_livre (&b); break;
                case 8: reparer (&b); break;
                case 9: supprime_abonnee (&b); break;
                case 10: modifier_abonne (&b); break;
                case 11: modifier_livre (&b); break;
                case 0: break;
            }
    }
    mon problème c'est au en tête des fonction il m'affiche au première fonction
    "two or more data types in declaration specifiers"
    et autre "expected ')' before '*' token"
    merci d'avance

  2. #2
    Inactif  


    Homme Profil pro
    Doctorant sécurité informatique — Diplômé master Droit/Économie/Gestion
    Inscrit en
    Décembre 2011
    Messages
    9 026
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 32
    Localisation : France, Loire (Rhône Alpes)

    Informations professionnelles :
    Activité : Doctorant sécurité informatique — Diplômé master Droit/Économie/Gestion
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2011
    Messages : 9 026
    Par défaut
    C'est gentil de nous dire qu'il y a 11 erreurs, mais ne pourrais-tu pas nous mettre tout ce que dit ton compilateur qu'on voie quelles sont ces 11 erreurs, ça sera beaucoup plus facile et rapide pour nous de t'aider.

    Ensuite, pourrais-tu enlever les 1. 2. 3. à chaque ligne stp?

    Déjà : void main () c'est int main (void) il faudra donc mettre un return 0; à la fin de ton main.


    Ensuite, dans ton main, tu utilises des variables que tu n'as pas déclaré avant leur utilisation.

    Essaye aussi d'utiliser des nom de variables explicites

  3. #3
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2012
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 33
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2012
    Messages : 5
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    //main
    int main (void)
    { int choix,rd;
      biblio b;
      livres l;
      abonnee a;
     
         void principale()
          pritnf("choix : ");
          scanf("%d",&choix);
          switch(choix)
            {
                case 1: ajout_livre (&b,&l); break;
                case 2: ajout_abonnee (&b,&a); break;
                case 3: emprunt_livre (&b); break;
                case 4: recherche_livre (b,rd); break;
                case 5: affiche_livre (b); break;
                case 6: rendre_livre (&b); break;
                case 7: supprime_livre (&b); break;
                case 8: reparer (&b); break;
                case 9: supprime_abonnee (&b); break;
                case 10: modifier_abonne (&b); break;
                case 11: modifier_livre (&b); break;
                case 0: break;
            }
    return 0;
    }
    j'espère que c'est juste le main, mais mon problém c'est au en tête des fonction!!

  4. #4
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 309
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 309
    Billets dans le blog
    5
    Par défaut
    Après une première compilation voila le résultat de gcc :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    main.c:72:1: error: expected ‘;’ after struct definition
    main.c:72:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]
    main.c: In function ‘void remplir_liste(biblio*, liste_livre*, livres)’:
    main.c:99:11: error: ‘null’ was not declared in this scope
    main.c:100:15: error: base operand of ‘->’ has non-pointer type ‘liste_livre’
    main.c:101:13: error: base operand of ‘->’ has non-pointer type ‘liste_livre’
    main.c:104:17: error: base operand of ‘->’ has non-pointer type ‘liste_livre’
    main.c: In function ‘int main(int, char**)’:
    main.c:120:5: error: expected initializer before ‘pritnf’
    main.c:124:31: error: ‘ajout_livre’ was not declared in this scope
    main.c:125:33: error: ‘ajout_abonnee’ was not declared in this scope
    main.c:126:30: error: ‘emprunt_livre’ was not declared in this scope
    main.c:127:34: error: ‘recherche_livre’ was not declared in this scope
    main.c:128:29: error: ‘affiche_livre’ was not declared in this scope
    main.c:129:29: error: ‘rendre_livre’ was not declared in this scope
    main.c:130:31: error: ‘supprime_livre’ was not declared in this scope
    main.c:131:24: error: ‘reparer’ was not declared in this scope
    main.c:132:33: error: ‘supprime_abonnee’ was not declared in this scope
    main.c:133:33: error: ‘modifier_abonne’ was not declared in this scope
    main.c:134:32: error: ‘modifier_livre’ was not declared in this scope
    make: *** [main.o] Erreur 1
    make: La cible « all » n'a pas pu être refabriquée à cause d'erreurs.
     
    Compilation exited abnormally with code 2 at Sat May 12 11:21:30
    La plupart des erreurs proviennent de la non déclaration des entêtes des fonctions en début de ton code.
    Pour faire simple tu utilises des fonctions qui sont déclarées après leur appel. Le compilateur ne les connaît pas encore!

  5. #5
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Mai 2012
    Messages
    5
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 33
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mai 2012
    Messages : 5
    Par défaut
    Voici mon programme complet.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
     
    //Déclaratin:
    //Déclaration : etat de la livre
    typedef struct
    {
        int emprunter;
        int disponible;
        int en_reparation;
    }etats;
     
    //Déclaration :  date
    typedef struct
    {
        int jour;
        int mois;
        int annee;
    }date;
     
    //Déclaration :  livre
    typedef struct
    {
        int code;
        char titre[50];
        char auteur[30];
        date annee_pub;
        etats etat;
    }livres;
     
    //Déclaration : abonnee
    typedef struct
    {
        char nom[30];
        int code;
        livres emprunt;
    }abonnee;
     
    //Déclaration : liste de livre
    //noeud
    typedef struct noeud
    {
        livres valeur;
        struct noeud *next;
    }noeud;
    //liste
    typedef struct
    {
        noeud *tete;
    }liste_livre;
     
    //Déclaration : liste d'abonnée
    //noeud
    typedef struct noeud_1
    {
        abonnee valeur;
        struct noeud_1 *next;
    }noeud_1;
    //liste
    typedef struct
    {
        noeud_1 *tete;
    }liste_abonnee;
     
    //Déclaration bibliothéque
    typedef struct biblio
    {
        liste_livre dispo;
        liste_livre empr;
        liste_livre repar;
        liste_abonnee abon;
    }
     
    ////ajout_livre
    //saisir_livre
    void saisir_livre (livres *l)
    {
        printf("saisir les info de ce livre :\n");
        printf("\n Code :\t");
        scanf("%d",&l->code);
        printf("\n Titre :\t");
        scanf("%s",l->titre);
        printf("\n auteur :\t");
        scanf("%s",l->auteur);
        printf("\n année de publication :\t");
        printf("\n jour :");
        scanf("%d",&l->annee_pub.jour);
        printf("\n mois :");
        scanf("%d",&l->annee_pub.mois);
        printf("\n annee :");
        scanf("%d",&l->annee_pub.annee);
        l->etat.disponible=1;
    }
    //remplir_liste
    void remplir_liste (biblio *b, liste_livre *dispo, livres l)
    { noeud *n,*i;
        n=(noeud*)malloc(sizeof(noeud));
        n->valeur=l;
        n->next=null;
        if (b->dispo->tete==null)
            b->dispo->tete=n;
        else
         {
            i=b->dispo->tete;
            while (i->next!=null)
              i=i->next;
            n->next=i;
         }
    }
     
    //Ajout
    void ajout_livre (biblio *b,livres *l)
    { int r;
        saisir_livre(&l);
        remplir_liste(&b,&dispo,l);
        printf("voulez-vous saisir un autre livre?\n (1 si oui, 0 sinon)\n");
        scanf("%d",r);
        while(r!=0)
          {
            saisir_livre(&l);
            remplir_liste(&b,&dispo,l);
          }
    }
     
    ////ajout_abonnée
    //saisir_abonnée
    void saisir_abonnee (abonnee *a)
    {
        printf("saisir les info de l'abonnée :\n");
        printf("Nom :\n");
        scanf("%s",a->nom);
        printf("Identifiant :\n");
        scanf("%d",a->code);
    }
     
    //Ajout
    void ajout_abonnee (biblio *b,abonee a)
    { int r;
        saisir_abonnee(&a);
        remplir_liste(&b,&abon,a);
        printf("voulez-vous saisir un autre abonnée?\n (1 si oui, 0 sinon)\n");
        scanf("%d",r);
        while(r!=0)
          {
            saisir_abonnee(&a);
            remplir_liste(&b,&abon,a);
          }
    }
     
    ////Emprunt: emprunter un livre a un abonnée
    //Recherche
    noeud* recherche (biblio b,liste_livre dispo, livres rd)
    {noeud *i;
        i=b.dispo.tete;
        while ((i!=null)&&(i->valeur!=rd.code))
           i=i->next;
        return i;
    }
     
    //supprimer: supprimer selon position
    void supp_pos (biblio *b,liste_livre *dispo, livres posl)
    {noeud *i, *j, *h;
        h=b->dispo;
        if (posl=h->tete)
          {
            i=h->tete;
            h->tete=h->tete->next;
            free(i);
          }
        else
          {
              j=h->tete;
              i=h->tete->next;
              while ((i!=null)&&(i!=posl))
                 {
                   j=i;
                   i=i->next;
                 }
              j->next=i->next;
              free(i);
          }
    }
     
    //Emprunt
    void emprunt_livre (biblio *b)
    {noeud *posl, *ra, *rd;
        printf(" saisir l'identifiant de l'abonnée :\t");
        scanf("%d";ra);
        posa=recheche(b,abon,ra);
        if (posa!=null)
         {
          printf("\n saisir le code de livre a emprunter :\t");
          scanf("%d";rd);
          posl=recheche(b,dispo,rd);
          if (posl!=null)
            {
             remplir_liste(&b,&empr,posl);
             b->abon->ra->emprunt=posl
             supp_pos(&b,&dispo,posl);
            }
          else
             printf("ce livre n'existe pas dans norte bibliothéque!!");
         }
        else
         printf("ont a aucun abonnée avec ce code dans notre bibliothéque!!");
    }
     
    ////recherche d'un livre étont donné son code
    int recherche_livre (biblio b,int rd)
    {
      printf("\n saisir le code de livre a rechercher :\t");
      scanf("%d";rd);
      if (recheche(b,dispo,rd)!=null)
        return 1;
      else
        if (recheche(b,empr,rd)!=null)
          return 2;
        else
          if (recheche(b,repar,rd)!=null)
            return 3;
          else
            return 0;
    }
     
    ////affichage: afficher les livre parus a une année donnée
    //affiche
    void affiche (biblio b,liste_livre dispo)
    {noeud *k;
      k=b.dispo.livre;
      printf("Code : %d",k.code);
      printf("Titre : %s",k.titre);
      printf("Auteur : %s",k.auteur);
      printf("année de publicatoin : %d / %d / %d",k.annee_pub.jour,k.annee_pub.mois,k.annee_pub.annee);
      if (k.etats.disponible=1)
         printf("etats : disponible");
      else
         if (k.etats.emprunter=1)
           printf("etats : emprunter");
         else
           if (k.etats.en_reparation=1)
              printf("etats : en reparatio");
    }
    //recherche_livres
    void recherche_livres (biblio b,liste_livre dispo, int an)
    {noeud *i,*k;
     int n,j;
      i=b.dispo.tete;
      k=b.dispo.tete;
      while (i!=null)
       {
        n++;
        i=i->next;
       }
     
      for(j=1;j<=n;j++)
       {
        if (k->livre->annee_pub->annee=an))
         affiche(b,dispo,pos);
        else
         k=k->next;
       }
     
    //affiche_livre
    void affiche_livre (biblio b)
    {int an;
      printf("saisir l'année");
      scanf("%d",an);
      recherche_livres (b,dispo,an);
      recherche_livres (b,empr,an);
      recherche_livres (b,repar,an);
    }
     
    ////Rendre un livre
    void rendre_livre (biblio *b)
    {noeud *posl, *ra, *rd;
        printf(" saisir l'identifiant de l'abonnée :\t");
        scanf("%d";ra);
        posa=recheche(b,abon,ra);
        if (posa!=null)
         {
          printf("\n saisir le code de livre a emprunter :\t");
          scanf("%d";rd);
          posl=recheche(b,dispo,rd);
          if (posl!=null)
            {
             remplir_liste(&b,&dispo,posl);
             b->abon->ra->emprunt=null;
             supp_pos(&b,&empr,posl);
            }
          else
             printf("ce livre n'existe pas dans norte bibliothéque!!");
         }
        else
         printf("ont a aucun abonnée avec ce code dans notre bibliothéque!!");
    }
     
     
    ////supprimer un livre etant donné son code
    void supprime_livre (biblio *b)
    { noeud *posl;int r
        printf("\n saisir le code de livre a emprunter :\t");
        scanf("%d";r);
        posl=recherche_livre(b,r);
        if (posl=1)
          supp_pos(&b,&dispo,posl);
        else
          if (posl=2)
            supp_pos(&b,&empr,posl);
          else
            if (posl=3)
              supp_pos(&b,&repar,posl);
            else
              printf("ce livre n'existe pas dans norte bibliothéque!!");
    }
     
    ////réparer un livre
    void reparer (biblio *b)
    {int c,p;
        printf("saisir le code de livre a rechercher :\t");
        scanf("%d";c);
        p=recherche_livre(b,c);
        if (p=1)
         {
          posl=recheche(b,dispo,c);
          remplir_liste(&b,&repar,posl);
          supp_pos(&b,&dispo,posl);
         }
        else
          if (p=2)
           {
            posl=recheche(b,empr,c);
            i=b->abon->tete;
            while ((i!=null)&&(i->valeur!=posl))
              i=i->next;
            posa=i;
            supp_pos(&b,&abon,posa);
            remplir_liste(&b,&repar,posl);
            supp_pos(&b,&empr,posl);
           }
          else
            if (posl=3)
              printf("ce livre est déja en état de réparation.")
            else
              printf("ce livre n'existe pas dans norte bibliothéque!!");
    }
     
    ////supprimer un abonnée
    void supprime_abonnee (biblio *b)
    {abonee *posa, int r;
        printf("\n saisir le code d'abonnée a supprimer :\t");
        scanf("%d";r);
        posa=recherche(b,abon,r);
        if (posl!=null)
          supp_pos(&b,&abon,posa);
        else
          printf("ont a aucun abonnée avec ce code dans notre bibliothéque!!");
    }
     
    ////modifier un abonnée
    //Menu modifier abonnée
    void menu_modif_abon()
    {
        printf("     \n******************************");
        printf("     \n******modifier l'abonnée******");
        printf("     \n******************************");
        printf("     \n**modifier :                **");
        printf("     \n***1-Nom                    **");
        printf("     \n***2-Identifiant            **");
        printf("     \n***3-livre                  **");
        printf("     \n***4-Retour au menu         **");
        printf("     \n******************************");
    }
     
    //Modifier
    void modifier_abonne (biblio *b)
    { int choix, new_id;
      char new_nom[30];
        printf("saisir le Identifiant d'abonnée a madifier :\t");
        scanf("%d";r);
        posa=recherche(b,abon,r);
        if (posa!=null)
         {
          void menu_modif_abon()
          printf("choix : ");
          scanf("%d",&choix);
          switch(choix)
            {
              case 1:
                {
                    printf("saisir le nouveau Nom :");
                    scanf("%s",new_nom);
                    bilio->abon->nom=new_nom;
                }break;
              case 2:
                {
                    printf("saisir le nouveau Identifiant :");
                    scanf("%d",new_id);
                    bilio->abon->code=new_id;
                }break;
              case 3:
                {
                    printf("saisir le code de nouveau livre a emprunter :");
                    scanf("%d",new_empr);
                    posl=recheche(b,dispo,new_empr);
                    if (posl!=null)
                      {
                        enl=posa->emprunt;
                        remplir_liste(&b,&empr,posl);
                        b->abon->posa->emprunt=posl
                        supp_pos(&b,&dispo,posl);
                        remplir_liste(&b,&dispo,enl);
                      }break;
                    else
                        printf("ce livre n'existe pas dans norte bibliothéque!!");
                }
              case 4:principale();break;
            }
         }
        else
          printf("ont a aucun abonnée avec ce code dans notre bibliothéque!!");
    }
     
    //modifier un livre
    //menu modifier livre
    void menu_modif_livre()
    {
        printf("     \n*****************************");
        printf("     \n******modifier le livre******");
        printf("     \n*****************************");
        printf("     \n**modifier :               **");
        printf("     \n***1-Code                  **");
        printf("     \n***2-Titre                 **");
        printf("     \n***3-Auteur                **");
        printf("     \n***4-Année de publication  **");
        printf("     \n***5-Retour au menu        **");
        printf("     \n*****************************");
    }
     
    //Modifier
    void modifier_livre (biblio *b)
    { int choix, new_id, r, new_code, new_annee;
      char new_titre[50], new_auteur[30];
        printf("saisir le Code de livre a madifier :\t");
        scanf("%d";r);
        a=recherche_livre(b,r);
        if (a=1)
          posl=recherche(b,dispo,r);
        else
          if (a=2)
            posl=recherche(b,empr,r);
          else
            if (a=3)
              posl=recherche(b,repar,r);
            else
              printf("ce livre n'existe pas dans norte bibliothéque!!");
     
        if (posl!=0)
         {
          void menu_modif_livre()
          pritnf("choix : ");
          scanf("%d",&choix);
          switch(choix)
            {
              case 1:
                {
                    printf("saisir le nouveau Code :");
                    scanf("%s",new_code);
                    bilio->posl->code=new_code;
                }break;
     
              case 2:
                {
                    printf("saisir le nouveau tirtre :");
                    scanf("%d",new_titre);
                    bilio->posl->titre=new_titre;
                }break;
     
              case 3:
                {
                    printf("saisir l'auteur de livre :");
                    scanf("%d",new_auteur);
                    bilio->posl->auteur=new_auteur;
                }break;
     
              case 4:
                {
                    printf("saisir l'année de publication :");
                    scanf("%d",new_annee);
                    bilio->posl->annee_pub=new_annee;
                }break;
     
              case 5:principale();break;
            }
         }
    }
     
     
    //main
    //Menu principale
    void principale()
    {
        printf("     \n+--------------------------------------+");
        printf("     \n|--Maghraoui Hassen   ||     FSB (C) --|");
        printf("     \n+---------------------------2011/2012--+");
        printf("\n\n");
        printf("     \n+--------------------------------------+");
        printf("     \n|-----------Menu principale------------|");
        printf("     \n|--------------------------------------|");
        printf("     \n|--    1-Ajouter un nouveau livre    --|");
        printf("     \n|--    2-Ajouter un nouvel abonné    --|");
        printf("     \n|--    3-Emprunter un livre          --|");
        printf("     \n|--    4-Rechercher un livre         --|");
        printf("     \n|--    5-Afficher les livre          --|");
        printf("     \n|--    6-Rendre un livre             --|");
        printf("     \n|--    7-Supprimer un livre          --|");
        printf("     \n|--    8-Réparation un livre         --|");
        printf("     \n|--    9-Supprimer un abonné         --|");
        printf("     \n|--    10-Modifier un abonné         --|");
        printf("     \n|--    11-Modifier un livre          --|");
        printf("     \n|--    0-Quitter                     --|");
        printf("     \n+--------------------------------------+");
    }
     
    //main
    void main ()
    { int choix,rd;
      biblio b;
      livres l;
      abonnee a;
        void principale()
          pritnf("choix : ");
          scanf("%d",&choix);
          switch(choix)
            {
                case 1: ajout_livre (&b,&l); break;
                case 2: ajout_abonnee (&b,&a); break;
                case 3: emprunt_livre (&b); break;
                case 4: recherche_livre (b,rd); break;
                case 5: affiche_livre (b); break;
                case 6: rendre_livre (&b); break;
                case 7: supprime_livre (&b); break;
                case 8: reparer (&b); break;
                case 9: supprime_abonnee (&b); break;
                case 10: modifier_abonne (&b); break;
                case 11: modifier_livre (&b); break;
                case 0: break;
            }
    }

  6. #6
    Expert confirmé
    Avatar de gerald3d
    Homme Profil pro
    Conducteur de train
    Inscrit en
    Février 2008
    Messages
    2 309
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Côte d'Or (Bourgogne)

    Informations professionnelles :
    Activité : Conducteur de train
    Secteur : Transports

    Informations forums :
    Inscription : Février 2008
    Messages : 2 309
    Billets dans le blog
    5
    Par défaut
    Avec ton code complet la liste des erreurs s'allonge

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    main.c:72:1: error: expected ‘;’ after struct definition
    main.c:72:1: warning: ‘typedef’ was ignored in this declaration [enabled by default]
    main.c: In function ‘void remplir_liste(biblio*, liste_livre*, livres)’:
    main.c:99:11: error: ‘null’ was not declared in this scope
    main.c:100:15: error: base operand of ‘->’ has non-pointer type ‘liste_livre’
    main.c:101:13: error: base operand of ‘->’ has non-pointer type ‘liste_livre’
    main.c:104:17: error: base operand of ‘->’ has non-pointer type ‘liste_livre’
    main.c: In function ‘void ajout_livre(biblio*, livres*)’:
    main.c:114:18: error: cannot convert ‘livres**’ to ‘livres*’ for argument ‘1’ to ‘void saisir_livre(livres*)’
    main.c:115:21: error: ‘dispo’ was not declared in this scope
    main.c:117:15: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int[-Wformat]
    main.c:120:22: error: cannot convert ‘livres**’ to ‘livres*’ for argument ‘1’ to ‘void saisir_livre(livres*)’
    main.c: In function ‘void saisir_abonnee(abonnee*)’:
    main.c:133:21: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int[-Wformat]
    main.c: At global scope:
    main.c:137:31: error: ‘abonee’ has not been declared
    main.c: In function ‘void ajout_abonnee(biblio*, int)’:
    main.c:139:20: error: cannot convert ‘int*’ to ‘abonnee*’ for argument ‘1’ to ‘void saisir_abonnee(abonnee*)’
    main.c:140:21: error: ‘abon’ was not declared in this scope
    main.c:142:15: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘int[-Wformat]
    main.c:145:24: error: cannot convert ‘int*’ to ‘abonnee*’ for argument ‘1’ to ‘void saisir_abonnee(abonnee*)’
    main.c: In function ‘noeud* recherche(biblio, liste_livre, livres)’:
    main.c:155:14: error: ‘null’ was not declared in this scope
    main.c:155:36: error: no match foroperator!=’ in ‘i->noeud::valeur != rd.livres::code’
    main.c: In function ‘void supp_pos(biblio*, liste_livre*, livres)’:
    main.c:163:8: error: cannot convert ‘liste_livre’ to ‘noeud*’ in assignment
    main.c:164:15: error: ‘noeud’ has no member named ‘tete’
    main.c:166:12: error: ‘noeud’ has no member named ‘tete’
    main.c:167:10: error: ‘noeud’ has no member named ‘tete’
    main.c:167:18: error: ‘noeud’ has no member named ‘tete’
    main.c:172:12: error: ‘noeud’ has no member named ‘tete’
    main.c:173:12: error: ‘noeud’ has no member named ‘tete’
    main.c:174:18: error: ‘null’ was not declared in this scope
    main.c:174:29: error: no match foroperator!=’ in ‘i != posl’
    main.c: In function ‘void emprunt_livre(biblio*)’:
    main.c:188:13: error: expected ‘)’ before ‘;’ token
    main.c:188:16: error: expected ‘;’ before ‘)’ token
    main.c:188:17: warning: statement has no effect [-Wunused-value]
    main.c:189:3: error: ‘posa’ was not declared in this scope
    main.c:189:19: error: ‘abon’ was not declared in this scope
    main.c:189:26: error: ‘recheche’ was not declared in this scope
    main.c:190:13: error: ‘null’ was not declared in this scope
    main.c:193:17: error: expected ‘)’ before ‘;’ token
    main.c:193:20: error: expected ‘;’ before ‘)’ token
    main.c:193:21: warning: statement has no effect [-Wunused-value]
    main.c:194:23: error: ‘dispo’ was not declared in this scope
    main.c:197:22: error: ‘empr’ was not declared in this scope
    main.c:198:11: error: base operand of ‘->’ has non-pointer type ‘liste_abonnee’
    main.c:199:6: error: expected ‘;’ before ‘supp_pos’
    main.c: In function ‘int recherche_livre(biblio, int)’:
    main.c:212:13: error: expected ‘)’ before ‘;’ token
    main.c:212:16: error: expected ‘;’ before ‘)’ token
    main.c:212:17: warning: statement has no effect [-Wunused-value]
    main.c:213:18: error: ‘dispo’ was not declared in this scope
    main.c:213:26: error: ‘recheche’ was not declared in this scope
    main.c:213:29: error: ‘null’ was not declared in this scope
    main.c:216:20: error: ‘empr’ was not declared in this scope
    main.c:219:22: error: ‘repar’ was not declared in this scope
    main.c: In function ‘void affiche(biblio, liste_livre)’:
    main.c:229:13: error: ‘struct liste_livre’ has no member named ‘livre’
    main.c:230:24: error: request for member ‘code’ in ‘k’, which is of non-class type ‘noeud*’
    main.c:231:25: error: request for member ‘titre’ in ‘k’, which is of non-class type ‘noeud*’
    main.c:232:26: error: request for member ‘auteur’ in ‘k’, which is of non-class type ‘noeud*’
    main.c:233:51: error: request for member ‘annee_pub’ in ‘k’, which is of non-class type ‘noeud*’
    main.c:233:68: error: request for member ‘annee_pub’ in ‘k’, which is of non-class type ‘noeud*’
    main.c:233:85: error: request for member ‘annee_pub’ in ‘k’, which is of non-class type ‘noeud*’
    main.c:234:9: error: request for member ‘etats’ in ‘k’, which is of non-class type ‘noeud*’
    main.c:237:11: error: request for member ‘etats’ in ‘k’, which is of non-class type ‘noeud*’
    main.c:240:13: error: request for member ‘etats’ in ‘k’, which is of non-class type ‘noeud*’
    main.c: In function ‘void recherche_livres(biblio, liste_livre, int)’:
    main.c:249:13: error: ‘null’ was not declared in this scope
    main.c:257:14: error: ‘noeud’ has no member named ‘livre’
    main.c:257:41: error: expected primary-expression before ‘)’ token
    main.c:257:41: error: expected ‘;’ before ‘)’ token
    main.c:265:1: error: a function-definition is not allowed here before ‘{’ token
    main.c:275:1: error: a function-definition is not allowed here before ‘{’ token
    main.c:549:1: error: expected ‘}’ at end of input

Discussions similaires

  1. Gestion des bibliothéques
    Par dyala dans le forum Cas d'utilisation
    Réponses: 2
    Dernier message: 20/05/2009, 21h23
  2. [Software] Gestion de bibliothèque
    Par Wookai dans le forum Autres Logiciels
    Réponses: 4
    Dernier message: 02/05/2009, 14h44
  3. Gestion des bibliothéques via intranet
    Par dyala dans le forum UML
    Réponses: 3
    Dernier message: 27/02/2009, 23h08
  4. Problème avec la "Gestion des bibliothèques dynamiques"
    Par GoustiFruit dans le forum Delphi
    Réponses: 15
    Dernier message: 31/05/2006, 09h54

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo