Salut,
J'ai essayer de mettre en pratique la définition d'une structure avec pointeur mais ca bug:(
voici une partie du code dans lequel je defini et initialise mes variables
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
typedef struct test{
short *outLtable;
short *outMtable;
short *outRtable;
short *outStable;
double *outDtable;
} test;
test *option ;
/* if (option = malloc(sizeof(test)) == NULL) { */
if ( (option = malloc(sizeof(*option)) ) == NULL) {
perror("malloc failed");
exit(EXIT_FAILURE);
}
option -> outDtable = NULL;
option -> outLtable = NULL;
option -> outMtable = NULL;
option -> outRtable = NULL;
option -> outStable = NULL; |
il me dit uhhandle exception8O
pourtant il me semblait que c'est ainsi qu'il fallait initialiser. Le problem semble venir des lignes option -> outDtable = NULL; mais je ne comprens pas pourquoi.
merci pour votre aide