Bonjour,
Je me doute que mes questions doivent etre probablement tres stupides, mais n'ayant plus touche au C depuis longtemps, j'ai du mal avec certaines choses, notamment les pointeurs/Structures, avec des erreurs que je ne comprends pas.
Voila mon code(J'ai selectionné que ce que je jugeais utile, j'espere que ca suffira
main.c:
#include "structures.h"
game = (struct partie *)malloc(sizeof(struct partie)); Ligne 13
initialiser(game->othellier); Ligne 19
structures.h :
typedef struct partie *partie;
struct partie {
int curseur;
int trait;
int longueur;
int final;
joueur joueur[2];
struct coup coup[MAX_COUPS];
othellier othellier;
};
typedef struct othellier *othellier;
struct othellier{
int damier[MAX_INDEX];
int materiel[JOUEURS];
};
Log :
Exécution de make...
C:\Dev-Cpp\bin\make.exe -f "C:\Dev-Cpp\Othelooo\Makefile.win" all
C:\Dev-Cpp\bin\gcc.exe -c main.c -o main.o -I"C:/Dev-Cpp/include"
main.c:13: warning: initialization from incompatible pointer type
main.c:13: error: initializer element is not constant
main.c:13: warning: data definition has no type or storage class
main.c: In function `main':
main.c:19: error: request for member `othellier' in something not a structure or union
C:\Dev-Cpp\bin\make.exe: *** [main.o] Error 1
Merci à ceux prets a passer du temps pour m'aider !
Configuration: Windows Vista
Firefox 2.0.0.12