Hello
J'ai un soucis au niveau de l'accès à la structure Pouet et à la modification de celle ci.
A la ligne "partie->princ = deck_new();" dans la fonction deal_main(), Code Blocks me renvoie: C:\*************\main.c|13|error: dereferencing pointer to incomplete type. Il me le dit aussi a chauqe fois que j'ecris pouet->
Si je mets pouet. ,il me retourne C:\**********\main.c|23|error: request for member `hands' in something not a structure or union|
Comment puis-je modifier la structure?
Merci!
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 typedef struct { Deck *table; Deck *princ; Deck **hands; int nhands; } Pouet; struct Pouet *deal_main (struct Pouet *partie) { gint rank, suit; int i,j,k; Card *c; partie->princ = deck_new(); } int main (int argc, char *argv[]) { Pouet *partie; gint rank, suit; int i,j,k; partie = malloc(sizeof(struct Pouet)); partie.nhands = 9; deal_main(&partie); for (i=0;i<partie.nhands;i++) deck_print(partie->hands[i]); return 0; }
Partager