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 :

Mon code sans erreurs mais ne marche pas


Sujet :

C

  1. #1
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut Mon code sans erreurs mais ne marche pas
    Bonjour,

    voici mon programme qui simule une file d'attente avec un seul serveur

    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
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <stdbool.h>
     
    #define A "Arrivée"
    #define S "service"
    #define D "départ"
    #define a1 6
    #define b1 24
    #define a2 10
    #define b2 16
     
    typedef enum {a, s, d} type;
     
    struct list_event
    {
        type event_type;
        float event_time;
        struct list_event *next;
    };
     
     
    void initialisation()
    {
       float  t = 0;
       float  q = 0;
       int  Nmax = 50;
       int qmax = 0;
       int Nclient = 1;
       float Toinact = 0;
     
    }
     
    struct list_event *extraire(struct list_event **p_tete)
    {
        struct list_event *event = NULL;
     
        /*  test la validite du parametre */
        if (p_tete != NULL)
        {
            struct list_event *p;
     
            p = *p_tete;
            if (p == NULL)
            {
                printf("liste vide\n");
            }
            else
            {
                *p_tete = p->next;
                event = p;
    	    printf("l'evennement extrait est: ");
                /* on force l'affichage */
                fflush(stdout);
            }
        }
     
        return event;
    }
     
     
     
     
     
     
    /*  purge le tampon du flux d'entree standard  */
    void purger(void)
    {
        int c;
     
        while ((c = fgetc(stdin)) != '\n' && c != EOF)
        {
        }
    }
    void pause(char const *message)
    {
        int c;
     
        if (message != NULL)
        {
            printf("%s ", message);
            fflush(stdout);
        }
     
        c = getchar();
        if (c != '\n' && c != EOF)
        {
            purger();
        }
    }
     
    void insertion(struct list_event **p_tete, char s, float val)
    {
     
     
     
        /*  programmation defensive: on s'assure de la validite des parametres */
        if (p_tete != NULL)
        {
            struct list_event *pt1;
            struct list_event *pt2;
            struct list_event *event;
     
     
            pt1 = *p_tete;
     
            event = malloc(sizeof *event);
            /*  tester si l'allocation a reussi */
            if (event != NULL)
            {
                event->event_type = s;
                event->event_time = val;
     
                if (pt1 == NULL)
                {
                    /* insertion au debut */
     
                    event->next = pt1;
                    /*  on retourne l'adresse de la tete de la liste */
                    *p_tete = event;
                }
                else
                {
                    /*  on se place au debut de la liste */
                    pt2 = pt1;
                    /*  on parcourt toute la liste */
    		while (pt2 != NULL)
                    {
     
                        pt1 = pt2;
                        pt2 = pt2->next;
     
                    }
                    if (pt2 == *p_tete)
                    {
     
                        *p_tete = event;
                        event->next = pt2;
                    }
                    else
                    {
                        pt1->next = event;
                        event->next = pt2;
                    }
                }
            }
        }
    }
     
     
    void affichage(struct list_event *tete)
    {
        /* pas d'affichage, la liste est vide */
        if (tete != NULL)
        {
            struct list_event *courant;
            courant = tete;
            while (courant != NULL)
            {
                printf(" le type de l'evennement est: %c\n", courant->event_type);
                printf(" le temps de l'evennement est: %f\n", courant->event_time);
     
                courant = courant->next;
            }
        }
    }
     
     
    void arrive()
    {
     
        float t, Tarr, x;
        struct list_event *event;
        struct list_event **p_tete;
        float h;
        char a, s;
        int q;
        int qmax;
        bool serveur_libre;
     
     
     
        t = event->event_time;
        /* le %18 crorespond a un modulo 18 pour faire entre 6 et 24 on calcule la taille de l'interval:
    24-6=18
    donc un rand()%18
    et de rajouter 6 pour te replacer dans l'interval voulu:
    donc a = 15+rand()%12 */
        srand(GetTickCount ());
        h=6+rand()%18;
        x = h *(b1 - a1) + a1;
        Tarr = t + x;
     
        insertion(p_tete, a,  Tarr);
     
        q= q+1;
        if (q > qmax)
        {
            qmax = q;
        }
        if (serveur_libre)
        {
        insertion(p_tete, s, t);
        }
     
    }
     
     
    void debuter_service()
    {
        float t, h, x, Totinact ;
        float Tinact = 0;
        struct list_event *event;
        bool serveur_libre = false;
        int q = q - 1;
        float Tdep;
        struct list_event **p_tete;
     
        t = event->event_time;
        srand(GetTickCount ());
        h=10+rand()%6;
        x = h *(b2 - a2) + a2;
     
        Tdep = t + x;
        insertion(p_tete, d, Tdep);
        srand(GetTickCount ());
        Tinact=rand()%1;
        if (t-Tinact != 0)
        {
            Totinact = Totinact + (t- Tinact);
        }
    }
     
    void partir()
    {
        struct list_event *event;
        struct list_event **p_tete;
        float t, Tinact;
        bool serveur_libre;
        int q, Nclient;
        t = event->event_time;
        serveur_libre = true;
     
        Tinact = t;
        Nclient = Nclient + 1;
        if (q != 0)
        {
            insertion(p_tete, d, t);
        }
    }
     
    int main()
    {
        struct list_event *tete = NULL;
        int Nclient;
        struct list_event **p_tete;
        struct list_event *event;
        char tp;
        int Nmax = 5;
    initialisation();
    while (Nclient < Nmax)
    {
        extraire(p_tete);
        printf(" entrez le type de l'evenement: ");
                fflush(stdout);
                scanf("%c",&tp);
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
               switch (tp)
               {
                 case a:
                  arriver();
                  break;
                 case s:
                  debuter_service();
                  break;
                 case d:
                  depart();
                  break;
               }
               return 0;
    }
     
    }
    résultat de la compilation:

    .objs\main.o:main.c: (.text+0x355): undefined reference to `GetTickCount'
    .objs\main.o:main.c: (.text+0x47b): undefined reference to `arriver'
    .objs\main.o:main.c: (.text+0x489): undefined reference to `depart'
    collect2: ld returned 1 exit status
    Process terminated with status 1 (0 minutes, 6 seconds)
    0 errors, 0 warnings


    Qu'est ce que je dois faire pour régler ce problème et pour que mon programme puisse se dérouler normalement en console.

    Merci

  2. #2
    Expert confirmé
    Avatar de Thierry Chappuis
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Mai 2005
    Messages
    3 499
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : Suisse

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Mai 2005
    Messages : 3 499
    Points : 5 360
    Points
    5 360
    Par défaut
    Il n'est pas erreurs. Voici ce que raconte mon compilateur:

    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
    gcc -o test.o -c -Wall -Wextra -ansi -pedantic -Wwrite-strings -Wstrict-prototypes -Wunreachable-code -Wconversion -std=c99 test.c
    test.c:3:19: error: conio.h: No such file or directory
    test.c:25: warning: function declaration isn't a prototype
    test.c: In function 'initialisation':
    test.c:31: warning: unused variable 'Toinact'
    test.c:30: warning: unused variable 'Nclient'
    test.c:29: warning: unused variable 'qmax'
    test.c:28: warning: unused variable 'Nmax'
    test.c:27: warning: unused variable 'q'
    test.c:26: warning: unused variable 't'
    test.c: At top level:
    test.c:171: warning: function declaration isn't a prototype
    test.c: In function 'arrive':
    test.c:190: warning: implicit declaration of function 'GetTickCount'
    test.c:190: warning: passing argument 1 of 'srand' as unsigned due to prototype
    test.c:195: warning: passing argument 2 of 'insertion' with different width due to prototype
    test.c:195: warning: passing argument 3 of 'insertion' as 'float' rather than 'double' due to prototype
    test.c:204: warning: passing argument 2 of 'insertion' with different width due to prototype
    test.c:204: warning: passing argument 3 of 'insertion' as 'float' rather than 'double' due to prototype
    test.c: At top level:
    test.c:211: warning: function declaration isn't a prototype
    test.c: In function 'debuter_service':
    test.c:221: warning: passing argument 1 of 'srand' as unsigned due to prototype
    test.c:226: warning: passing argument 2 of 'insertion' with different width due to prototype
    test.c:226: warning: passing argument 3 of 'insertion' as 'float' rather than 'double' due to prototype
    test.c:227: warning: passing argument 1 of 'srand' as unsigned due to prototype
    test.c:215: warning: unused variable 'serveur_libre'
    test.c: At top level:
    test.c:236: warning: function declaration isn't a prototype
    test.c: In function 'partir':
    test.c:249: warning: passing argument 2 of 'insertion' with different width due to prototype
    test.c:249: warning: passing argument 3 of 'insertion' as 'float' rather than 'double' due to prototype
    test.c: At top level:
    test.c:254: warning: function declaration isn't a prototype
    test.c: In function 'main':
    test.c:276: warning: implicit declaration of function 'arriver'
    test.c:282: warning: implicit declaration of function 'depart'
    test.c:258: warning: unused variable 'event'
    test.c:255: warning: unused variable 'tete'
    scons: *** [test.o] Error 1
    scons: building terminated because of errors.
    Essaie de corriger tout ça pendant que je regarde.

    Thierry

  3. #3
    Membre chevronné
    Homme Profil pro
    Dév. Java & C#
    Inscrit en
    Octobre 2002
    Messages
    1 414
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Dév. Java & C#
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Octobre 2002
    Messages : 1 414
    Points : 1 996
    Points
    1 996
    Par défaut
    Bonjour,

    Vous avez déjà pris votre café ce matin?

    -arriver n'est pas égal à arrive
    -depart est différent de partir

    Pour GetTickCount, je ne sais pas d'où vient cette fonction.

    Il me semble de ces erreurs sont découvertes lors de la phase de "link" et non celle de compilation. Je conseille de régler correctement votre compilateur pour qu'il vous fasse remarquer certains avertissements.

    Relisez votre code attentivement et tout ira pour le mieux

    Bonne journée

  4. #4
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    Merci

    je corrige tout de suite...

  5. #5
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    voici le "nouveau" code

    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
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <stdbool.h>
     
    #define A "Arrivée"
    #define S "service"
    #define D "départ"
    #define a1 6
    #define b1 24
    #define a2 10
    #define b2 16
     
    typedef enum {a, s, d} type;
     
    struct list_event
    {
        type event_type;
        float event_time;
        struct list_event *next;
    };
     
     
    void initialisation()
    {
       float  t = 0;
       float  q = 0;
       int  Nmax = 50;
       int qmax = 0;
       int Nclient = 1;
       float Totinact = 0;
     
    }
     
    struct list_event *extraire(struct list_event **p_tete)
    {
        struct list_event *event = NULL;
     
        /*  test la validite du parametre */
        if (p_tete != NULL)
        {
            struct list_event *p;
     
            p = *p_tete;
            if (p == NULL)
            {
                printf("liste vide\n");
            }
            else
            {
                *p_tete = p->next;
                event = p;
    	    printf("l'evennement extrait est: ");
                /* on force l'affichage */
                fflush(stdout);
            }
        }
     
        return event;
    }
     
     
     
     
     
     
    /*  purge le tampon du flux d'entree standard  */
    void purger(void)
    {
        int c;
     
        while ((c = fgetc(stdin)) != '\n' && c != EOF)
        {
        }
    }
    void pause(char const *message)
    {
        int c;
     
        if (message != NULL)
        {
            printf("%s ", message);
            fflush(stdout);
        }
     
        c = getchar();
        if (c != '\n' && c != EOF)
        {
            purger();
        }
    }
     
    void insertion(struct list_event **p_tete, char s, float val)
    {
     
     
     
        /*  programmation defensive: on s'assure de la validite des parametres */
        if (p_tete != NULL)
        {
            struct list_event *pt1;
            struct list_event *pt2;
            struct list_event *event;
     
     
            pt1 = *p_tete;
     
            event = malloc(sizeof *event);
            /*  tester si l'allocation a reussi */
            if (event != NULL)
            {
                event->event_type = s;
                event->event_time = val;
     
                if (pt1 == NULL)
                {
                    /* insertion au debut */
     
                    event->next = pt1;
                    /*  on retourne l'adresse de la tete de la liste */
                    *p_tete = event;
                }
                else
                {
                    /*  on se place au debut de la liste */
                    pt2 = pt1;
                    /*  on parcourt toute la liste */
    		while (pt2 != NULL)
                    {
     
                        pt1 = pt2;
                        pt2 = pt2->next;
     
                    }
                    if (pt2 == *p_tete)
                    {
     
                        *p_tete = event;
                        event->next = pt2;
                    }
                    else
                    {
                        pt1->next = event;
                        event->next = pt2;
                    }
                }
            }
        }
    }
     
     
    void affichage(struct list_event *tete)
    {
        /* pas d'affichage, la liste est vide */
        if (tete != NULL)
        {
            struct list_event *courant;
            courant = tete;
            while (courant != NULL)
            {
                printf(" le type de l'evennement est: %c\n", courant->event_type);
                printf(" le temps de l'evennement est: %f\n", courant->event_time);
     
                courant = courant->next;
            }
        }
    }
     
     
    void arrive()
    {
     
        float t, Tarr, x;
        struct list_event *event;
        struct list_event **p_tete;
        float h;
        char a, s;
        int q;
        int qmax;
        bool serveur_libre;
     
     
     
        t = event->event_time;
        /* le %18 crorespond a un modulo 18 pour faire entre 6 et 24 on calcule la taille de l'interval:
    24-6=18
    donc un rand()%18
    et de rajouter 6 pour te replacer dans l'interval voulu:
    donc a = 15+rand()%12 */
        srand(GetTickCount ());
        h=6+rand()%18;
        x = h *(b1 - a1) + a1;
        Tarr = t + x;
     
        insertion(p_tete, a,  Tarr);
     
        q= q+1;
        if (q > qmax)
        {
            qmax = q;
        }
        if (serveur_libre)
        {
        insertion(p_tete, s, t);
        }
     
    }
     
     
    void debuter_service()
    {
        float t, h, x, Totinact ;
        float Tinact = 0;
        struct list_event *event;
        bool serveur_libre = false;
        int q = q - 1;
        float Tdep;
        struct list_event **p_tete;
     
        t = event->event_time;
        srand(GetTickCount ());
        h=10+rand()%6;
        x = h *(b2 - a2) + a2;
     
        Tdep = t + x;
        insertion(p_tete, d, Tdep);
        srand(GetTickCount ());
        Tinact=rand()%1;
        if (t-Tinact != 0)
        {
            Totinact = Totinact + (t- Tinact);
        }
    }
     
    void partir()
    {
        struct list_event *event;
        struct list_event **p_tete;
        float t, Tinact;
        bool serveur_libre;
        int q, Nclient;
        t = event->event_time;
        serveur_libre = true;
     
        Tinact = t;
        Nclient = Nclient + 1;
        if (q != 0)
        {
            insertion(p_tete, d, t);
        }
    }
     
    int main()
    {
        struct list_event *tete = NULL;
        int Nclient;
        struct list_event **p_tete;
        struct list_event *event;
        char tp;
        int Nmax = 5;
    initialisation();
    while (Nclient < Nmax)
    {
        extraire(p_tete);
        printf(" entrez le type de l'evenement: ");
                fflush(stdout);
                scanf("%c",&tp);
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
               switch (tp)
               {
                 case a:
                  arrive();
                  break;
                 case s:
                  debuter_service();
                  break;
                 case d:
                  partir();
                  break;
               }
               return 0;
    }
     
    }
    GetTickCount utilisée ici

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    srand(GetTickCount ());
        h=6+rand()%18;
    Pour faire un peu comme le randomize

  6. #6
    Expert confirmé
    Avatar de Thierry Chappuis
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Mai 2005
    Messages
    3 499
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : Suisse

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Mai 2005
    Messages : 3 499
    Points : 5 360
    Points
    5 360
    Par défaut
    • Tu appelles srand() à plusieurs reprises dans ton programme: une fois dans arriver() et 2 fois dans debuter_service(). Il suffit de l'appeller au début de main() en lui envoyant la valeur retournée par time(NULL) qui a l'avantage sur GetTickCount() (fonction windows ?) d'être standard.
    • Conio n'est pas portable et ne te sert à rien dans ton prog.
    • Les fonction initialisation(), arriver(), debuter_service(), partir() et main() ne sont pas des prototypes. Ajouter void.
    • Dans le switch de main(), a, s et d doivent être des caractères i.e. 'a', 's', 'p'.
    • initialisation() ne fait rien.
    • arrive() ou arriver() appelle event->event_time, mais event n'est pas initialisé
    • etc.


    Thierry

  7. #7
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    Citation Envoyé par Thierry Chappuis Voir le message
    • Tu appelles srand() à plusieurs reprises dans ton programme: une fois dans arriver() et 2 fois dans debuter_service(). Il suffit de l'appeller au début de main() en lui envoyant la valeur retournée par time(NULL) qui a l'avantage sur GetTickCount() (fonction windows ?) d'être standard.
    • Conio n'est pas portable et ne te sert à rien dans ton prog.
    • Les fonction initialisation(), arriver(), debuter_service(), partir() et main() ne sont pas des prototypes. Ajouter void.
    • Dans le switch de main(), a, s et d doivent être des caractères i.e. 'a', 's', 'p'.
    • initialisation() ne fait rien.
    • arrive() ou arriver() appelle event->event_time, mais event n'est pas initialisé
    • etc.


    Merci

    voici un autre j'espère avoir corrigé quelques erreurs

    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
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <stdbool.h>
     
    #define A "Arrivée"
    #define S "service"
    #define D "départ"
    #define a1 6
    #define b1 24
    #define a2 10
    #define b2 16
     
    typedef enum {a, s, d} type;
     
    struct list_event
    {
        type event_type;
        float event_time;
        struct list_event *next;
    };
     
     
    void initialisation(void)
    {
       float  t = 0;
       float  q = 0;
       int  Nmax = 50;
       int qmax = 0;
       int Nclient = 1;
       float Totinact = 0;
     
    }
     
    struct list_event *extraire(struct list_event **p_tete)
    {
        struct list_event *event = NULL;
     
        /*  test la validite du parametre */
        if (p_tete != NULL)
        {
            struct list_event *p;
     
            p = *p_tete;
            if (p == NULL)
            {
                printf("liste vide\n");
            }
            else
            {
                *p_tete = p->next;
                event = p;
    	    printf("l'evennement extrait est: ");
                /* on force l'affichage */
                fflush(stdout);
            }
        }
     
        return event;
    }
     
     
     
     
     
     
    /*  purge le tampon du flux d'entree standard  */
    void purger(void)
    {
        int c;
     
        while ((c = fgetc(stdin)) != '\n' && c != EOF)
        {
        }
    }
    void pause(char const *message)
    {
        int c;
     
        if (message != NULL)
        {
            printf("%s ", message);
            fflush(stdout);
        }
     
        c = getchar();
        if (c != '\n' && c != EOF)
        {
            purger();
        }
    }
     
    void insertion(struct list_event **p_tete, char s, float val)
    {
     
     
     
        /*  programmation defensive: on s'assure de la validite des parametres */
        if (p_tete != NULL)
        {
            struct list_event *pt1;
            struct list_event *pt2;
            struct list_event *event;
     
     
            pt1 = *p_tete;
     
            event = malloc(sizeof *event);
            /*  tester si l'allocation a reussi */
            if (event != NULL)
            {
                event->event_type = s;
                event->event_time = val;
     
                if (pt1 == NULL)
                {
                    /* insertion au debut */
     
                    event->next = pt1;
                    /*  on retourne l'adresse de la tete de la liste */
                    *p_tete = event;
                }
                else
                {
                    /*  on se place au debut de la liste */
                    pt2 = pt1;
                    /*  on parcourt toute la liste */
    		while (pt2 != NULL)
                    {
     
                        pt1 = pt2;
                        pt2 = pt2->next;
     
                    }
                    if (pt2 == *p_tete)
                    {
     
                        *p_tete = event;
                        event->next = pt2;
                    }
                    else
                    {
                        pt1->next = event;
                        event->next = pt2;
                    }
                }
            }
        }
    }
     
     
    void affichage(struct list_event *tete)
    {
        /* pas d'affichage, la liste est vide */
        if (tete != NULL)
        {
            struct list_event *courant;
            courant = tete;
            while (courant != NULL)
            {
                printf(" le type de l'evennement est: %c\n", courant->event_type);
                printf(" le temps de l'evennement est: %f\n", courant->event_time);
     
                courant = courant->next;
            }
        }
    }
     
     
    void arrive(void)
    {
     
        float t, Tarr, x;
        struct list_event *event;
        struct list_event **p_tete;
        float h;
        char a, s;
        int q;
        int qmax;
        bool serveur_libre;
     
     
     
        t = event->event_time;
        /* le %18 crorespond a un modulo 18 pour faire entre 6 et 24 on calcule la taille de l'interval:
    24-6=18
    donc un rand()%18
    et de rajouter 6 pour te replacer dans l'interval voulu:
    donc a = 15+rand()%12 */
     
        h=6+rand()%18;
        x = h *(b1 - a1) + a1;
        Tarr = t + x;
     
        insertion(p_tete, a,  Tarr);
     
        q= q+1;
        if (q > qmax)
        {
            qmax = q;
        }
        if (serveur_libre)
        {
        insertion(p_tete, s, t);
        }
     
    }
     
     
    void debuter_service(void)
    {
        float t, h, x, Totinact ;
        float Tinact = 0;
        struct list_event *event;
        bool serveur_libre = false;
        int q = q - 1;
        float Tdep;
        struct list_event **p_tete;
     
        t = event->event_time;
     
        h=10+rand()%6;
        x = h *(b2 - a2) + a2;
     
        Tdep = t + x;
        insertion(p_tete, d, Tdep);
     
        Tinact=rand()%1;
        if (t-Tinact != 0)
        {
            Totinact = Totinact + (t- Tinact);
        }
    }
     
    void partir(void)
    {
        struct list_event *event;
        struct list_event **p_tete;
        float t, Tinact;
        bool serveur_libre;
        int q, Nclient;
        t = event->event_time;
        serveur_libre = true;
     
        Tinact = t;
        Nclient = Nclient + 1;
        if (q != 0)
        {
            insertion(p_tete, d, t);
        }
    }
     
    int main(void)
    {
        struct list_event *tete = NULL;
        int Nclient;
        struct list_event **p_tete;
        struct list_event *event;
        char tp;
        int Nmax = 5;
        float mp;
    initialisation();
     
    while (Nclient < Nmax)
    {
     
        srand(GetTickCount ());
        extraire(p_tete);
        printf(" entrez le type de l'evenement: ");
                fflush(stdout);
                scanf("%c",&tp);
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
     
                printf(" entrez le temps de l'evenement: ");
                fflush(stdout);
                scanf("%f", &mp);
                purger();
                event->event_time = mp;
                event->event_type = tp;
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
               switch (tp)
               {
                 case 'a':
                  arrive();
                  break;
                 case 's':
                  debuter_service();
                  break;
                 case 'd':
                  partir();
                  break;
               }
               return 0;
    }
     
    }
    Thierry
    mais le problème de GetTickCount y est toujours

  8. #8
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    là j'ai éliminé GetTickCount

    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
        #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <stdbool.h>
     
    #define A "Arrivée"
    #define S "service"
    #define D "départ"
    #define a1 6
    #define b1 24
    #define a2 10
    #define b2 16
     
    typedef enum {a, s, d} type;
     
    struct list_event
    {
        type event_type;
        float event_time;
        struct list_event *next;
    };
     
     
    void initialisation(void)
    {
       float  t = 0;
       float  q = 0;
       int  Nmax = 50;
       int qmax = 0;
       int Nclient = 1;
       float Totinact = 0;
     
    }
     
    struct list_event *extraire(struct list_event **p_tete)
    {
        struct list_event *event = NULL;
     
        /*  test la validite du parametre */
        if (p_tete != NULL)
        {
            struct list_event *p;
     
            p = *p_tete;
            if (p == NULL)
            {
                printf("liste vide\n");
            }
            else
            {
                *p_tete = p->next;
                event = p;
    	    printf("l'evennement extrait est: ");
                /* on force l'affichage */
                fflush(stdout);
            }
        }
     
        return event;
    }
     
     
     
     
     
     
    /*  purge le tampon du flux d'entree standard  */
    void purger(void)
    {
        int c;
     
        while ((c = fgetc(stdin)) != '\n' && c != EOF)
        {
        }
    }
    void pause(char const *message)
    {
        int c;
     
        if (message != NULL)
        {
            printf("%s ", message);
            fflush(stdout);
        }
     
        c = getchar();
        if (c != '\n' && c != EOF)
        {
            purger();
        }
    }
     
    void insertion(struct list_event **p_tete, char s, float val)
    {
     
     
     
        /*  programmation defensive: on s'assure de la validite des parametres */
        if (p_tete != NULL)
        {
            struct list_event *pt1;
            struct list_event *pt2;
            struct list_event *event;
     
     
            pt1 = *p_tete;
     
            event = malloc(sizeof *event);
            /*  tester si l'allocation a reussi */
            if (event != NULL)
            {
                event->event_type = s;
                event->event_time = val;
     
                if (pt1 == NULL)
                {
                    /* insertion au debut */
     
                    event->next = pt1;
                    /*  on retourne l'adresse de la tete de la liste */
                    *p_tete = event;
                }
                else
                {
                    /*  on se place au debut de la liste */
                    pt2 = pt1;
                    /*  on parcourt toute la liste */
    		while (pt2 != NULL)
                    {
     
                        pt1 = pt2;
                        pt2 = pt2->next;
     
                    }
                    if (pt2 == *p_tete)
                    {
     
                        *p_tete = event;
                        event->next = pt2;
                    }
                    else
                    {
                        pt1->next = event;
                        event->next = pt2;
                    }
                }
            }
        }
    }
     
     
    void affichage(struct list_event *tete)
    {
        /* pas d'affichage, la liste est vide */
        if (tete != NULL)
        {
            struct list_event *courant;
            courant = tete;
            while (courant != NULL)
            {
                printf(" le type de l'evennement est: %c\n", courant->event_type);
                printf(" le temps de l'evennement est: %f\n", courant->event_time);
     
                courant = courant->next;
            }
        }
    }
     
     
    void arrive(void)
    {
     
        float t, Tarr, x;
        struct list_event *event;
        struct list_event **p_tete;
        float h;
        char a, s;
        int q;
        int qmax;
        bool serveur_libre;
     
     
     
        t = event->event_time;
        /* le %18 crorespond a un modulo 18 pour faire entre 6 et 24 on calcule la taille de l'interval:
    24-6=18
    donc un rand()%18
    et de rajouter 6 pour te replacer dans l'interval voulu:
    donc a = 15+rand()%12 */
     
        h=6+rand()%18;
        x = h *(b1 - a1) + a1;
        Tarr = t + x;
     
        insertion(p_tete, a,  Tarr);
     
        q= q+1;
        if (q > qmax)
        {
            qmax = q;
        }
        if (serveur_libre)
        {
        insertion(p_tete, s, t);
        }
     
    }
     
     
    void debuter_service(void)
    {
        float t, h, x, Totinact ;
        float Tinact = 0;
        struct list_event *event;
        bool serveur_libre = false;
        int q = q - 1;
        float Tdep;
        struct list_event **p_tete;
     
        t = event->event_time;
     
        h=10+rand()%6;
        x = h *(b2 - a2) + a2;
     
        Tdep = t + x;
        insertion(p_tete, d, Tdep);
     
        Tinact=rand()%1;
        if (t-Tinact != 0)
        {
            Totinact = Totinact + (t- Tinact);
        }
    }
     
    void partir(void)
    {
        struct list_event *event;
        struct list_event **p_tete;
        float t, Tinact;
        bool serveur_libre;
        int q, Nclient;
        t = event->event_time;
        serveur_libre = true;
     
        Tinact = t;
        Nclient = Nclient + 1;
        if (q != 0)
        {
            insertion(p_tete, d, t);
        }
    }
     
    int main(void)
    {
        struct list_event *tete = NULL;
        int Nclient;
        struct list_event **p_tete;
        struct list_event *event;
        char tp;
        int Nmax = 5;
        float mp;
    initialisation();
     
    while (Nclient < Nmax)
    {
     
     
        extraire(p_tete);
        printf(" entrez le type de l'evenement: ");
                fflush(stdout);
                scanf("%c",&tp);
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
     
                printf(" entrez le temps de l'evenement: ");
                fflush(stdout);
                scanf("%f", &mp);
                purger();
                event->event_time = mp;
                event->event_type = tp;
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
               switch (tp)
               {
                 case 'a':
                  arrive();
                  break;
                 case 's':
                  debuter_service();
                  break;
                 case 'd':
                  partir();
                  break;
               }
               return 0;
    }
     
    }
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    Checking for existence: C:\Program Files\CodeBlocks\tp4.exe
    Executing: C:\Program Files\CodeBlocks/console_runner.exe "C:\Program Files\CodeBlocks\tp4.exe"  (in .)
    Process terminated with status 1 (0 minutes, 6 seconds)
    0 errors, 0 warnings

    mais, (il y a toujours un "mais" ) je ne peux pas exécuter mon programme même si j'ai un fichier exécutable

    j'ai dans la console

    presse ENTER to continue

    et puis plus rien

  9. #9
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 381
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 381
    Points : 41 582
    Points
    41 582
    Par défaut
    La variable locale Nclient n'est pas initialisée, elle peut donc se retrouver avec une valeur supérieure à 5...

  10. #10
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    Citation Envoyé par Médinoc Voir le message
    La variable locale Nclient n'est pas initialisée, elle peut donc se retrouver avec une valeur supérieure à 5...
    Bonjour,

    la variable Nclient est initialisé à 1

  11. #11
    Membre chevronné
    Homme Profil pro
    Dév. Java & C#
    Inscrit en
    Octobre 2002
    Messages
    1 414
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Dév. Java & C#
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Octobre 2002
    Messages : 1 414
    Points : 1 996
    Points
    1 996
    Par défaut
    Citation Envoyé par acacia Voir le message
    Bonjour,

    la variable Nclient est initialisé à 1

    Je te conseille de te replonger dans ton livre de C voire de programmation.

    Tu déclares deux variables NClient (elles sont dans deux "scopes" différent"). Donc la variable Nclient de main n'est jamais initialisée.

  12. #12
    Expert confirmé
    Avatar de Thierry Chappuis
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Mai 2005
    Messages
    3 499
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : Suisse

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Industrie Pharmaceutique

    Informations forums :
    Inscription : Mai 2005
    Messages : 3 499
    Points : 5 360
    Points
    5 360
    Par défaut
    Citation Envoyé par acacia Voir le message
    Bonjour,

    la variable Nclient est initialisé à 1
    Non! Comme je te l'ai dit plus haut, ta fonction initialisation() ne fait rien. Les variables que tu définis et initialises dans le corps de cette fonction sont des variables locales qui, par ailleurs, ne sont pas utilisées. La durée de vie de ces variables est limitée à la durée d'exécution de la fonction.

    Si tu veux savoir comment initialiser des variables de main() avec ta fonction initialisation(), regarde dans ton livre de C au chapitre sur les pointeurs. Tu devrais y trouver ton bonheur.

    Thierry

  13. #13
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    est-ce que je peux les initialiser directement dans le main sans passer par une fonction initialisation?

    je crois que c'est la fonction "menu" qui manque à mon programme est c'est pour cela que je ne vois rien sur la console

    j'essaye de corriger

    Merci

  14. #14
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 381
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 381
    Points : 41 582
    Points
    41 582
    Par défaut
    Oui, tu peux.

  15. #15
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    voilà c'est fait

    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
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
    #include <stdbool.h>
     
    #define A "Arrivée"
    #define S "service"
    #define D "départ"
    #define a1 6
    #define b1 24
    #define a2 10
    #define b2 16
     
    typedef enum {a, s, d} type;
     
    struct list_event
    {
        type event_type;
        float event_time;
        struct list_event *next;
    };
     
     
     
     
    struct list_event *extraire(struct list_event **p_tete)
    {
        struct list_event *event = NULL;
     
        /*  test la validite du parametre */
        if (p_tete != NULL)
        {
            struct list_event *p;
     
            p = *p_tete;
            if (p == NULL)
            {
                printf("liste vide\n");
            }
            else
            {
                *p_tete = p->next;
                event = p;
    	    printf("l'evennement extrait est: ");
                /* on force l'affichage */
                fflush(stdout);
            }
        }
     
        return event;
    }
     
     
     
     
     
     
    /*  purge le tampon du flux d'entree standard  */
    void purger(void)
    {
        int c;
     
        while ((c = fgetc(stdin)) != '\n' && c != EOF)
        {
        }
    }
    void pause(char const *message)
    {
        int c;
     
        if (message != NULL)
        {
            printf("%s ", message);
            fflush(stdout);
        }
     
        c = getchar();
        if (c != '\n' && c != EOF)
        {
            purger();
        }
    }
     
    void insertion(struct list_event **p_tete, char s, float val)
    {
     
     
     
        /*  programmation defensive: on s'assure de la validite des parametres */
        if (p_tete != NULL)
        {
            struct list_event *pt1;
            struct list_event *pt2;
            struct list_event *event;
     
     
            pt1 = *p_tete;
     
            event = malloc(sizeof *event);
            /*  tester si l'allocation a reussi */
            if (event != NULL)
            {
                event->event_type = s;
                event->event_time = val;
     
                if (pt1 == NULL)
                {
                    /* insertion au debut */
     
                    event->next = pt1;
                    /*  on retourne l'adresse de la tete de la liste */
                    *p_tete = event;
                }
                else
                {
                    /*  on se place au debut de la liste */
                    pt2 = pt1;
                    /*  on parcourt toute la liste */
    		while (pt2 != NULL)
                    {
     
                        pt1 = pt2;
                        pt2 = pt2->next;
     
                    }
                    if (pt2 == *p_tete)
                    {
     
                        *p_tete = event;
                        event->next = pt2;
                    }
                    else
                    {
                        pt1->next = event;
                        event->next = pt2;
                    }
                }
            }
        }
    }
     
     
    void affichage(struct list_event *tete)
    {
        /* pas d'affichage, la liste est vide */
        if (tete != NULL)
        {
            struct list_event *courant;
            courant = tete;
            while (courant != NULL)
            {
                printf(" le type de l'evennement est: %c\n", courant->event_type);
                printf(" le temps de l'evennement est: %f\n", courant->event_time);
     
                courant = courant->next;
            }
        }
    }
     
     
    void arrive(void)
    {
     
        float t, Tarr, x;
        struct list_event *event;
        struct list_event **p_tete;
        float h;
        char a, s;
        int q;
        int qmax;
        bool serveur_libre;
     
     
     
        t = event->event_time;
        /* le %18 crorespond a un modulo 18 pour faire entre 6 et 24 on calcule la taille de l'interval:
    24-6=18
    donc un rand()%18
    et de rajouter 6 pour te replacer dans l'interval voulu:
    donc a = 15+rand()%12 */
     
        h=6+rand()%18;
        x = h *(b1 - a1) + a1;
        Tarr = t + x;
     
        insertion(p_tete, a,  Tarr);
     
        q= q+1;
        if (q > qmax)
        {
            qmax = q;
        }
        if (serveur_libre)
        {
        insertion(p_tete, s, t);
        }
     
    }
     
     
    void debuter_service(void)
    {
        float t, h, x, Totinact ;
        float Tinact = 0;
        struct list_event *event;
        bool serveur_libre = false;
        int q = q - 1;
        float Tdep;
        struct list_event **p_tete;
     
        t = event->event_time;
     
        h=10+rand()%6;
        x = h *(b2 - a2) + a2;
     
        Tdep = t + x;
        insertion(p_tete, d, Tdep);
     
        Tinact=rand()%1;
        if (t-Tinact != 0)
        {
            Totinact = Totinact + (t- Tinact);
        }
    }
     
    void partir(void)
    {
        struct list_event *event;
        struct list_event **p_tete;
        float t, Tinact;
        bool serveur_libre;
        int q, Nclient;
        t = event->event_time;
        serveur_libre = true;
     
        Tinact = t;
        Nclient = Nclient + 1;
        if (q != 0)
        {
            insertion(p_tete, d, t);
        }
    }
     
     
     
     
     
    int main(void)
    {
       float  t = 0;
       float  q = 0;
       int  Nmax = 50;
       int qmax = 0;
       int Nclient = 1;
       float Totinact = 0;
     
        struct list_event *tete = NULL;
     
        struct list_event **p_tete;
        struct list_event *event;
        char tp;
     
        float mp;
     
     
    while (Nclient < Nmax)
    {
     
     
        extraire(p_tete);
        printf(" entrez le type de l'evenement: ");
                fflush(stdout);
                scanf("%c",&tp);
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
     
                printf(" entrez le temps de l'evenement: ");
                fflush(stdout);
                scanf("%f", &mp);
                purger();
                event->event_time = mp;
                event->event_type = tp;
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
               switch (tp)
               {
                 case 'a':
                  arrive();
                  break;
                 case 's':
                  debuter_service();
                  break;
                 case 'd':
                  partir();
                  break;
               }
               return 0;
    }
     
    }
    maintenant il me reste le problème de ce qui doit s'afficher au moment de l'exécution

  16. #16
    Expert éminent sénior
    Avatar de Emmanuel Delahaye
    Profil pro
    Retraité
    Inscrit en
    Décembre 2003
    Messages
    14 512
    Détails du profil
    Informations personnelles :
    Âge : 67
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Retraité

    Informations forums :
    Inscription : Décembre 2003
    Messages : 14 512
    Points : 20 985
    Points
    20 985
    Par défaut
    Citation Envoyé par acacia Voir le message
    voici le "nouveau" code
    Je me demande ce que tu as corrigé...
    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
     
    Project   : Forums
    Compiler  : GNU GCC Compiler (called directly)
    Directory : C:\dev\forums\
    --------------------------------------------------------------------------------
    Switching to target: default
    Compiling: main.c
    main.c:25: warning: function declaration isn't a prototype
    main.c: In function `initialisation':
    main.c:26: warning: unused variable `t'
    main.c:27: warning: unused variable `q'
    main.c:28: warning: unused variable `Nmax'
    main.c:29: warning: unused variable `qmax'
    main.c:30: warning: unused variable `Nclient'
    main.c:31: warning: unused variable `Totinact'
    main.c: At top level:
    main.c:171: warning: function declaration isn't a prototype
    main.c: In function `arrive':
    main.c:190: warning: implicit declaration of function `GetTickCount'
    main.c:174: warning: 'event' might be used uninitialized in this function
    main.c:175: warning: 'p_tete' might be used uninitialized in this function
    main.c:177: warning: 'a' might be used uninitialized in this function
    main.c:177: warning: 's' might be used uninitialized in this function
    main.c:180: warning: 'serveur_libre' might be used uninitialized in this function
    main.c: At top level:
    main.c:211: warning: function declaration isn't a prototype
    main.c: In function `debuter_service':
    main.c:215: warning: unused variable `serveur_libre'
    main.c:214: warning: 'event' might be used uninitialized in this function
    main.c:218: warning: 'p_tete' might be used uninitialized in this function
    main.c: At top level:
    main.c:236: warning: function declaration isn't a prototype
    main.c: In function `partir':
    main.c:237: warning: 'event' might be used uninitialized in this function
    main.c:238: warning: 'p_tete' might be used uninitialized in this function
    main.c:241: warning: 'q' might be used uninitialized in this function
    main.c: At top level:
    main.c:254: warning: function declaration isn't a prototype
    main.c: In function `main':
    main.c:255: warning: unused variable `tete'
    main.c:258: warning: unused variable `event'
    main.c:288: warning: control reaches end of non-void function
    main.c:256: warning: 'Nclient' might be used uninitialized in this function
    main.c:257: warning: 'p_tete' might be used uninitialized in this function
    Linking console executable: console.exe
    .objs\dev\forums\main.o(.text+0x1a7): In function `arrive':
    C:/dev/forums/main.c:190: undefined reference to `GetTickCount'
    .objs\dev\forums\main.o(.text+0x23a): In function `debuter_service':
    C:/dev/forums/main.c:221: undefined reference to `GetTickCount'
    .objs\dev\forums\main.o(.text+0x293):C:/dev/forums/main.c:227: undefined reference to `GetTickCount'
    collect2: ld returned 1 exit status
    Process terminated with status 1 (0 minutes, 1 seconds)
    3 errors, 28 warnings
    Il semblerait que tu ignores certaines bases du C, notamment concernant la portée des variables, qui est limitée au bloc dans lequel elle est définie.

    Je te conseille de relire ton livre de C, concernant les variables, les fonctions et les paramètres.

  17. #17
    Rédacteur
    Avatar de Vincent Rogier
    Profil pro
    Inscrit en
    Juillet 2007
    Messages
    2 373
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : France

    Informations forums :
    Inscription : Juillet 2007
    Messages : 2 373
    Points : 5 306
    Points
    5 306
    Par défaut
    Juste pour la forme :

    Un code qui ne marche pas contient forcément des erreurs....

    Commence par initialiser tes variables !

    Et jette un coup d'oeil aux warnings du post d'Emmanuel

  18. #18
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    Citation Envoyé par Emmanuel Delahaye Voir le message
    Je me demande ce que tu as corrigé...
    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
     
    Project   : Forums
    Compiler  : GNU GCC Compiler (called directly)
    Directory : C:\dev\forums\
    --------------------------------------------------------------------------------
    Switching to target: default
    Compiling: main.c
    main.c:25: warning: function declaration isn't a prototype
    main.c: In function `initialisation':
    main.c:26: warning: unused variable `t'
    main.c:27: warning: unused variable `q'
    main.c:28: warning: unused variable `Nmax'
    main.c:29: warning: unused variable `qmax'
    main.c:30: warning: unused variable `Nclient'
    main.c:31: warning: unused variable `Totinact'
    main.c: At top level:
    main.c:171: warning: function declaration isn't a prototype
    main.c: In function `arrive':
    main.c:190: warning: implicit declaration of function `GetTickCount'
    main.c:174: warning: 'event' might be used uninitialized in this function
    main.c:175: warning: 'p_tete' might be used uninitialized in this function
    main.c:177: warning: 'a' might be used uninitialized in this function
    main.c:177: warning: 's' might be used uninitialized in this function
    main.c:180: warning: 'serveur_libre' might be used uninitialized in this function
    main.c: At top level:
    main.c:211: warning: function declaration isn't a prototype
    main.c: In function `debuter_service':
    main.c:215: warning: unused variable `serveur_libre'
    main.c:214: warning: 'event' might be used uninitialized in this function
    main.c:218: warning: 'p_tete' might be used uninitialized in this function
    main.c: At top level:
    main.c:236: warning: function declaration isn't a prototype
    main.c: In function `partir':
    main.c:237: warning: 'event' might be used uninitialized in this function
    main.c:238: warning: 'p_tete' might be used uninitialized in this function
    main.c:241: warning: 'q' might be used uninitialized in this function
    main.c: At top level:
    main.c:254: warning: function declaration isn't a prototype
    main.c: In function `main':
    main.c:255: warning: unused variable `tete'
    main.c:258: warning: unused variable `event'
    main.c:288: warning: control reaches end of non-void function
    main.c:256: warning: 'Nclient' might be used uninitialized in this function
    main.c:257: warning: 'p_tete' might be used uninitialized in this function
    Linking console executable: console.exe
    .objs\dev\forums\main.o(.text+0x1a7): In function `arrive':
    C:/dev/forums/main.c:190: undefined reference to `GetTickCount'
    .objs\dev\forums\main.o(.text+0x23a): In function `debuter_service':
    C:/dev/forums/main.c:221: undefined reference to `GetTickCount'
    .objs\dev\forums\main.o(.text+0x293):C:/dev/forums/main.c:227: undefined reference to `GetTickCount'
    collect2: ld returned 1 exit status
    Process terminated with status 1 (0 minutes, 1 seconds)
    3 errors, 28 warnings
    Il semblerait que tu ignores certaines bases du C, notamment concernant la portée des variables, qui est limitée au bloc dans lequel elle est définie.

    Je te conseille de relire ton livre de C, concernant les variables, les fonctions et les paramètres.
    j'ai corrigé ces problèmes dans mon dernier post, j'ai supprimé la fonction d'initialisation aussi.

    il me reste le problème de l'affichage

  19. #19
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2007
    Messages
    362
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2007
    Messages : 362
    Points : 419
    Points
    419
    Par défaut
    Bonsoir,

    Prends par exemple ta fonction "arrive".

    Que peux faire la première instruction :

    selon toi ?

    event est déclarée dans arrive donc complètement différente de event du main, et en plus, ce n'est qu'un pointeur qui donc ne pointe sur rien (pas d'allocation).

    Même problème dans le main avec

    Il faut vraiment que tu reprennes (au moins ) :
    • la notion de portée de variable ;
    • la question des pointeurs : déclarer un pointeur ne signifie pas allouer l'objet pointé.

  20. #20
    En attente de confirmation mail
    Étudiant
    Inscrit en
    Août 2007
    Messages
    419
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Août 2007
    Messages : 419
    Points : 263
    Points
    263
    Par défaut
    et bien je ne sais pas pourquoi mais si j'enlève une variable d'une fonction le compilateur me sort une erreur "undefined: first use in this function" quand je l'enleve du mainl me dit aussi qu'elle est indefined

    voici le nouveau code

    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
    #include <stdio.h>
    #include <stdlib.h>
    #include <conio.h>
     
     
    #include <stdbool.h>
     
    #define a1 6
    #define b1 24
    #define a2 10
    #define b2 16
     
    typedef enum {a, s, d} type;
     
    struct list_event
    {
        type event_type;
        float event_time;
        struct list_event *next;
    };
     
     
     
     
    struct list_event *extraire(struct list_event **p_tete)
    {
        struct list_event *event = NULL;
     
        /*  test la validite du parametre */
        if (p_tete != NULL)
        {
            struct list_event *p;
     
            p = *p_tete;
            if (p == NULL)
            {
                printf("liste vide\n");
            }
            else
            {
                *p_tete = p->next;
                event = p;
    	    printf("l'evennement extrait est: ");
                /* on force l'affichage */
                fflush(stdout);
            }
        }
     
        return event;
    }
     
     
     
     
     
     
    /*  purge le tampon du flux d'entree standard  */
    void purger(void)
    {
        int c;
     
        while ((c = fgetc(stdin)) != '\n' && c != EOF)
        {
        }
    }
    void pause(char const *message)
    {
        int c;
     
        if (message != NULL)
        {
            printf("%s ", message);
            fflush(stdout);
        }
     
        c = getchar();
        if (c != '\n' && c != EOF)
        {
            purger();
        }
    }
     
    void insertion(struct list_event **p_tete, char tp, float val)
    {
     
     
     
        /*  programmation defensive: on s'assure de la validite des parametres */
        if (p_tete != NULL)
        {
            struct list_event *pt1;
            struct list_event *pt2;
            struct list_event *event;
     
     
            pt1 = *p_tete;
     
            event = malloc(sizeof *event);
            /*  tester si l'allocation a reussi */
            if (event != NULL)
            {
                event->event_type = tp;
                event->event_time = val;
     
                if (pt1 == NULL)
                {
                    /* insertion au debut */
     
                    event->next = pt1;
                    /*  on retourne l'adresse de la tete de la liste */
                    *p_tete = event;
                }
                else
                {
                    /*  on se place au debut de la liste */
                    pt2 = pt1;
                    /*  on parcourt toute la liste */
    		while (pt2 != NULL)
                    {
     
                        pt1 = pt2;
                        pt2 = pt2->next;
     
                    }
                    if (pt2 == *p_tete)
                    {
     
                        *p_tete = event;
                        event->next = pt2;
                    }
                    else
                    {
                        pt1->next = event;
                        event->next = pt2;
                    }
                }
            }
        }
    }
     
     
    void affichage(struct list_event *tete)
    {
        /* pas d'affichage, la liste est vide */
        if (tete != NULL)
        {
            struct list_event *courant;
            courant = tete;
            while (courant != NULL)
            {
                printf(" le type de l'evennement est: %c\n", courant->event_type);
                printf(" le temps de l'evennement est: %f\n", courant->event_time);
     
                courant = courant->next;
            }
        }
    }
     
     
    void arrive(void)
    {
     
        float t, Tarr, x;
        struct list_event *event;
        struct list_event **p_tete;
        float h;
        char a, s;
        int q;
        int qmax;
        bool serveur_libre;
     
     
     
        t = event->event_time;
        /* le %18 crorespond a un modulo 18 pour faire entre 6 et 24 on calcule la taille de l'interval:
    24-6=18
    donc un rand()%18
    et de rajouter 6 pour te replacer dans l'interval voulu:
    donc a = 15+rand()%12 */
     
        h=6+rand()%18;
        x = h *(b1 - a1) + a1;
        Tarr = t + x;
     
        insertion(p_tete, a,  Tarr);
     
        q= q+1;
        if (q > qmax)
        {
            qmax = q;
        }
        if (serveur_libre)
        {
        insertion(p_tete, s, t);
        }
     
    }
     
     
    void debuter_service(void)
    {
        float t, h, x, Totinact ;
        float Tinact = 0;
        struct list_event *event;
        bool serveur_libre = false;
        int q = q - 1;
        float Tdep;
        struct list_event **p_tete;
     
        t = event->event_time;
     
        h=10+rand()%6;
        x = h *(b2 - a2) + a2;
     
        Tdep = t + x;
        insertion(p_tete, s, Tdep);
     
        Tinact=rand()%1;
        if (t-Tinact != 0)
        {
            Totinact = Totinact + (t- Tinact);
        }
    }
     
    void partir(void)
    {
        struct list_event *event;
        struct list_event **p_tete;
        float t, Tinact;
        bool serveur_libre;
        int q, Nclient;
        t = event->event_time;
        serveur_libre = true;
     
        Tinact = t;
        Nclient = Nclient + 1;
        if (q != 0)
        {
            insertion(p_tete, d, t);
        }
    }
     
     
    int menu(void)
    {
        int choix = 0;
        int rv = 0;
     
     
     
            printf("**********GESTION DE LA LISTE**********\n");
        printf(" 1-Inserer un nouvel evennement\n");
        printf(" (a) pour une nouvelle arrivee\n");
        printf(" (s) pour debuter le service\n");
        printf(" (d) pour depart\n");
        printf(" 2-Extraire un evennement\n");
        printf(" 3-Afficher le contenu\n");
        printf(" 4-EXIT\n");
        do
        {
            printf(" Faites votre choix: ");
    	/* forcer l'affichage*/
            fflush(stdout);
            rv = scanf("%d", &choix);
     
            purger();
        }
        while (rv != 1 || choix < 1 || choix > 4);
     
     
        return choix;
    }
     
     
    int main(void)
    {
       float  t = 0;
       float  q = 0;
       int  Nmax = 50;
       int qmax = 0;
       int Nclient = 1;
       float Totinact = 0;
     
        struct list_event *tete = NULL;
     
        struct list_event **p_tete;
        struct list_event *event;
        char choix;
     
        float val;
        char tp;
     
     
    while (choix != 4){
    while (Nclient < Nmax)
    {
     
      choix = menu();
     
     
     
     
               switch (choix)
               {
                 case 1:
                 printf(" entrez le type de l'evenement: ");
                fflush(stdout);
                scanf("%c",&tp);
                /*  on purge le tampon si necessaire */
                if (s != '\n' && s != EOF)
                {
                    purger();
                }
     
                printf(" entrez le temps de l'evenement: ");
                fflush(stdout);
                scanf("%f", &val);
                purger();
                 if (s == 'a')
                 {
                     arrive();
                 }
     
                 else
                 if (s == 'r')
                 {
                     debuter_service();
                 }
                 else
                 if (s == 'd')
                 {
                     partir();
                 }
     
                  arrive();
                  break;
     
     
     
                 case 2:
                extraire(&tete);
                  break;
     
     
                 case 3:
                  partir();
                  affichage(tete);
                pause("Appuyez sur ENTER pour revenir au menu...");
                 break;
     
                 case 4:
                /*  4 est un choix valide qui signifie quitter */
                break;
     
                default:
                printf(" choix inexistant\n");
                break;
               }
    }
               return 0;
    }
     
    }
    je ne sais pas ce qui lui manque encore pour qu'il s'exécute normalement

Discussions similaires

  1. Aucune Erreur mais sa marche pas
    Par Prog-Flo93 dans le forum VB.NET
    Réponses: 1
    Dernier message: 03/04/2011, 20h23
  2. Réponses: 9
    Dernier message: 01/12/2010, 09h57
  3. Réponses: 2
    Dernier message: 27/04/2009, 13h09
  4. PopUp marche sans GET mais ne trouve pas la page avec GET
    Par Orbiplanax dans le forum Général JavaScript
    Réponses: 11
    Dernier message: 20/12/2008, 13h01
  5. Réponses: 2
    Dernier message: 09/06/2006, 14h38

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