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 :

c'est un peut compliquer, de l'aide svp "othello" en C


Sujet :

C

  1. #1
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut c'est un peut compliquer, de l'aide svp "othello" en C
    bonjour,
    je vais essayé d'etre bref, j'essaye de faire un othello textuelle, c'est à dire qu'il s'affiche sur une fenetre dos, mon projet avancait bien jusqu'a que j'arrive au moment de codé la fonction qui annule un coup.
    pour ca, j'utilise une pile dynamique(FIFO). j'enregistre a fur et a mesure tout la grille du jeu et le joueur qui a jouer un coup.

    le probleme c'est qu'il ne rajoute qu'une cellule dans la pille, pas plus, meme si je joue une partie entiére.

    je sais pas comment vous pouvez m'aider sans avoir la totalité de ce que j'ai fait, c'est pour ca vous trouverez en pieces jointes tout mon projet d'othello. je les developper sous windows (devc++).

    aidez moi svp, c'est tres urgent, moi je lache pas l'affaire de toute facon de mon coté, j'aurai mal au crane jusqu'a que je trouve la ou je plante...

    normalement vous lancez l'appli et vous vous laissez guider... tappez 0m pendant une partie pour annuler un coup...
    Fichiers attachés Fichiers attachés

  2. #2
    Membre averti Avatar de Bob.Killer
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    336
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : France

    Informations forums :
    Inscription : Mai 2004
    Messages : 336
    Points : 332
    Points
    332
    Par défaut
    il faut que tu testes l'empilement dans ta pile s'il elle ne se fait pas bien, fait un autre programme pour tester cela
    Pensez aux tutoriels programmation : http://programmation.developpez.com/cours-tutoriels/

  3. #3
    Membre régulier
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 131
    Points : 114
    Points
    114
    Par défaut
    Oui l ideal serait de mettre les fonctions et strucutres relatives a la file (creyion de la file, empilement, depilement, etc ...) et de les tester.

    Voici un tutoriel sur les files. En esperant que cela puisse t aider.

  4. #4
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    bon apparament ca vient pas de ma file c'est un autre problem; copie d'(un tableau 2D ds un autre, comment ca se passe??
    j'ai essayé deux methodes, memcpy et la copie element par element, mais mon programme plante dés qu'il arrive a l'execution de cette ligne:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    void annulerCoup(int tab2[8][8],int joueur, PILE * pile)
    {
    depile(pile);
    joueur = (*pile)->joueur;
    memcpy(tab2,((*pile)->tab1),sizeof(tab2));    <======= ICI ca plante
    lancerPartie(tab2,joueur,pile);
    }
    ou sinon quand je remplace cette ligne qui plante par celle la:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    copier_tab(tab2,((*pile)->tab1));

  5. #5
    Membre régulier
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 131
    Points : 114
    Points
    114
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    void annulerCoup(int tab2[8][8],int joueur, PILE * pile)
    {
    depile(pile);
    joueur = (*pile)->joueur;
    memcpy(tab2,((*pile)->tab1),sizeof(tab2));    <======= ICI ca plante
    lancerPartie(tab2,joueur,pile);
    }
    pile est un pointeur , donc tu doit ecrire soit (*pile).joueur, soir pile->joueur mais surtout pas (*pile)->joueur

    Apres je n ai encore regarde ce qui a ete fait ^^

  6. #6
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    non, en fait, la structure de ma pile est :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    typedef struct estPile
    {
    int grille [8] [8];
    int joueur;
    struct estPile * suivant;
    }*PILE;

  7. #7
    Futur Membre du Club
    Inscrit en
    Mai 2007
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Mai 2007
    Messages : 15
    Points : 7
    Points
    7
    Par défaut
    Citation Envoyé par hichamo
    non, en fait, la structure de ma pile est :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    typedef struct estPile
    {
    int grille [8] [8];
    int joueur;
    struct estPile * suivant;
    }*PILE;

  8. #8
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    bon, ca marche toujour pas. j'ai refait toute ma pile, mais ca marche toujour pas, ca bloque sur la copie d'un tab ds un autre...

  9. #9
    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 hichamo
    bon, ca marche toujour pas. j'ai refait toute ma pile, mais ca marche toujour pas, ca bloque sur la copie d'un tab ds un autre
    On ne peut pas t'aider si on a pas la dernière version du code.
    Pas de Wi-Fi à la maison : CPL

  10. #10
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    bonjour a tous,
    j'ai changer le fichier joint, et vous avez la la derniere version de mon appli...
    ca ne marche toujour pas, pour ceux qui veulent m'aider, dans cette version vous trouverai toutes les fonctions qui concerne la pile ensemble dans le meme fichier.
    mais je pense pas que ca vient de la!!!

  11. #11
    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 hichamo
    bonjour a tous,
    j'ai changer le fichier joint, et vous avez la la derniere version de mon appli...
    ca ne marche toujour pas, pour ceux qui veulent m'aider, dans cette version vous trouverai toutes les fonctions qui concerne la pile ensemble dans le meme fichier.
    mais je pense pas que ca vient de la!!!
    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
     
    Project   : BE_C (Othello)
    Compiler  : GNU GCC Compiler (called directly)
    Directory : C:\dev\BE_C\
    --------------------------------------------------------------------------------
    Switching to target: default
    Compiling: boite_outils.c
    Compiling: pile_dyn.c
    pile_dyn.c: In function `pile_est_pleine':
    pile_dyn.c:48: warning: implicit declaration of function `malloc'
    pile_dyn.c:55: warning: implicit declaration of function `free'
    pile_dyn.c: In function `saisir_pile':
    pile_dyn.c:88: warning: unused variable `j'
    pile_dyn.c: At top level:
    pile_dyn.c:46: warning: unused parameter 'pile'
    pile_dyn.c: In function `pile_est_pleine':
    pile_dyn.c:57: warning: control reaches end of non-void function
    Compiling: regle.c
    In file included from affichage.h:1,
                     from regle.h:1,
                     from regle.c:1:
    sauv.h:5: warning: function declaration isn't a prototype
    In file included from regle.h:1,
                     from regle.c:1:
    affichage.h:4: warning: function declaration isn't a prototype
    affichage.h:6: warning: function declaration isn't a prototype
    affichage.h:8: warning: function declaration isn't a prototype
    affichage.h:24: warning: function declaration isn't a prototype
    In file included from regle.c:1:
    regle.h:13: warning: function declaration isn't a prototype
    regle.c: In function `unContreUn':
    regle.c:38: warning: array subscript has type `char'
    regle.c:44: warning: implicit declaration of function `system'
    regle.c: At top level:
    regle.c:74: warning: function declaration isn't a prototype
    Compiling: sauv.c
    In file included from sauv.c:1:
    sauv.h:5: warning: function declaration isn't a prototype
    sauv.c: In function `charger':
    sauv.c:69: warning: implicit declaration of function `coupsValides'
    sauv.c:70: warning: implicit declaration of function `nbTPions'
    sauv.c:77: warning: implicit declaration of function `ecran_passage'
    sauv.c:82: warning: implicit declaration of function `ecran_jeu'
    sauv.c:88: warning: implicit declaration of function `menu_inter'
    sauv.c:92: warning: implicit declaration of function `tolower'
    sauv.c:94: warning: array subscript has type `char'
    sauv.c:96: warning: implicit declaration of function `jouerUnCoup'
    sauv.c:110: warning: implicit declaration of function `nb_pion'
    sauv.c:114: warning: implicit declaration of function `ecran_gagner'
    sauv.c:125: warning: implicit declaration of function `menu_principal'
    sauv.c:126: warning: implicit declaration of function `system'
    sauv.c:141: warning: implicit declaration of function `ecran_passage_pc'
    sauv.c:147: warning: implicit declaration of function `ecran_jeu_pc'
    sauv.c:160: warning: array subscript has type `char'
    sauv.c:181: warning: implicit declaration of function `jouerUnCoupFacile'
    sauv.c: At top level:
    sauv.c:211: warning: function declaration isn't a prototype
    Compiling: test.c
    In file included from affichage.h:1,
                     from regle.h:1,
                     from test.c:1:
    sauv.h:5: warning: function declaration isn't a prototype
    In file included from regle.h:1,
                     from test.c:1:
    affichage.h:4: warning: function declaration isn't a prototype
    affichage.h:6: warning: function declaration isn't a prototype
    affichage.h:8: warning: function declaration isn't a prototype
    affichage.h:24: warning: function declaration isn't a prototype
    In file included from test.c:1:
    regle.h:13: warning: function declaration isn't a prototype
    test.c:6: warning: return type defaults to `int'
    test.c:6: warning: function declaration isn't a prototype
    test.c: In function `main':
    test.c:9: warning: control reaches end of non-void function
    Compiling: affichage.c
    In file included from affichage.h:1,
                     from affichage.c:1:
    sauv.h:5: warning: function declaration isn't a prototype
    In file included from affichage.c:1:
    affichage.h:4: warning: function declaration isn't a prototype
    affichage.h:6: warning: function declaration isn't a prototype
    affichage.h:8: warning: function declaration isn't a prototype
    affichage.h:24: warning: function declaration isn't a prototype
    affichage.c:5: warning: function declaration isn't a prototype
    affichage.c: In function `introduire':
    affichage.c:12: warning: implicit declaration of function `system'
    affichage.c:99: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:7: warning: unused variable `i'
    affichage.c:8: warning: unused variable `j'
    affichage.c: At top level:
    affichage.c:112: warning: function declaration isn't a prototype
    affichage.c: In function `menu_principal':
    affichage.c:116: warning: implicit declaration of function `init_grille'
    affichage.c:145: warning: implicit declaration of function `unContreUn'
    affichage.c:149: warning: implicit declaration of function `exit'
    affichage.c: At top level:
    affichage.c:154: warning: function declaration isn't a prototype
    affichage.c: In function `menu_ia':
    affichage.c:178: warning: implicit declaration of function `unContreMachineF'
    affichage.c: In function `menu_inter':
    affichage.c:212: warning: implicit declaration of function `annulerUnCoup'
    affichage.c: In function `ecran_jeu':
    affichage.c:230: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:233: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:234: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:237: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:238: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:239: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:242: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:243: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:244: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:245: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:256: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:260: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:283: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:287: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:223: warning: unused variable `c'
    affichage.c: In function `ecran_passage':
    affichage.c:305: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:308: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:309: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:312: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:313: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:314: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:317: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:318: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:319: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:320: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:331: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:335: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:354: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:355: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:359: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:360: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:298: warning: unused variable `c'
    affichage.c: In function `ecran_gagner':
    affichage.c:379: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:382: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:383: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:386: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:387: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:388: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:391: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:392: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:393: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:394: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:405: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:409: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:428: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:429: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:433: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:434: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:436: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:372: warning: unused variable `c'
    affichage.c: At top level:
    affichage.c:457: warning: function declaration isn't a prototype
    affichage.c: In function `ecran_jeu_pc':
    affichage.c:482: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:485: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:486: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:489: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:490: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:491: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:494: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:495: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:496: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:497: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:508: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:512: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:535: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:539: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:540: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:475: warning: unused variable `c'
    affichage.c: In function `ecran_passage_pc':
    affichage.c:559: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:562: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:563: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:566: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:567: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:568: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:571: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:572: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:573: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:574: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:585: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:589: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:608: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:609: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:613: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:614: warning: passing arg 2 of `afficher_string' discards qualifiers from pointer target type
    affichage.c:552: warning: unused variable `c'
    Linking console executable: C:\dev\BE_C\console.exe
    Process terminated with status 0 (0 minutes, 15 seconds)
    0 errors, 142 warnings
    Joli score...

    http://emmanuel-delahaye.developpez....tm#cfg_compilo
    Pas de Wi-Fi à la maison : CPL

  12. #12
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    c'est quoi cette option de compilation.
    et comment le faire sous devc++??

    je voi que je n'est faitque de la merde a ppaement...

  13. #13
    Expert éminent sénior
    Avatar de diogene
    Homme Profil pro
    Enseignant Chercheur
    Inscrit en
    Juin 2005
    Messages
    5 761
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Essonne (Île de France)

    Informations professionnelles :
    Activité : Enseignant Chercheur
    Secteur : Enseignement

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 761
    Points : 13 926
    Points
    13 926
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    void annulerCoup(int tab2[8][8],int joueur, PILE * pile)
    ....
    memcpy(tab2,((*pile)->tab1),sizeof(tab2));    <======= ICI ca plante
    tab2 est un pointeur et sizeof(tab2) donne la taille d'un pointeur, par exemple 4 sur ma machine, et non pas 8*8*sizeof(int). Une fonction ne peut pas savoir la taille d'un tableau si elle n'est pas passée explicitement en paramètre.

    Accessoirement,
    - la structure n'a pas de champ tab1 dans la définition que tu as donné
    - la définition de PILE comme pointeur sur structure n'est sans doute pas astucieuse et source d'erreur puisqu'elle masque le fait qu'il s'agit d'un type dérivé du type probablement plus "important" qui est la structure elle même
    Publication : Concepts en C

    Mon avatar : Glenn Gould

    --------------------------------------------------------------------------
    Une réponse vous a été utile ? Remerciez son auteur en cliquant le pouce vert !

  14. #14
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    bon, j'ai reussi a resoudre le probleme des tableau, c'etait un probleme de parametres de fonctions, c'est pas evident le passage des parametres
    je passai l'@ de ma pile quelque part, du coups le contenu, c'etai n'importe quoi.
    mais ne vous inquietez pas, je me suis trouver un autre probleme, je demanderai de l'aide si je bloc longtemps...
    merci a vous tous les gas

  15. #15
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    par contre, j'aimerai bien savoir avec quoi ta compilé mon aplli Emmanuel Delahaye, ca a l'aire interessant,, c'est quoi les options de compilation a rajouter.
    je coyai que c'etait "-wall" mais ca marche pas sur dev c++, il reconnai pas

  16. #16
    Expert éminent sénior
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 369
    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 369
    Points : 41 519
    Points
    41 519
    Par défaut
    La casse est importante : -wall est différent de -Wall.

    Généralement, je me contente de -Wall -Wextra -Wwrite-strings -O2,
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  17. #17
    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 hichamo
    par contre, j'aimerai bien savoir avec quoi ta compilé mon aplli Emmanuel Delahaye, ca a l'aire interessant,, c'est quoi les options de compilation a rajouter.
    Juste après la liste des erreurs, j'ai donné un lien, tu ne l'as pas vu ? pas visité ?
    Pas de Wi-Fi à la maison : CPL

  18. #18
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    si si je l'est visité, dailleur j'ai changer tous mes fichiers .h, pour ne plus les inclures plusieurs fois...
    par contre j'ai pas fait attention s'il y avait des infos sur le compilateur, je vais voir ca.
    Merci Medinoc pour ton aide precieuse...

  19. #19
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    33
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 33
    Points : 22
    Points
    22
    Par défaut
    effectivement, il y a tout ce qu'il faut dans le site que Emmanuel ma donnée , j'ai pas fait attention...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 0
    Dernier message: 01/07/2009, 09h16
  2. [Joomla!] Créee un site est utiliser Joomla comme noyau à l'aide d'Eclipse
    Par katebe dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 3
    Dernier message: 23/02/2009, 08h54
  3. transact sql compliqué. besoin d'aide.
    Par Actarus69 dans le forum Langage SQL
    Réponses: 2
    Dernier message: 21/09/2007, 17h17
  4. Est-ce qu'il ya une Aide ???
    Par alma7i dans le forum C++
    Réponses: 2
    Dernier message: 14/09/2005, 17h12

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