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
| my_fonction_allocation{
while((a_Sessions[i]!=NULL)&&(i<N))
{
i++;
}
/*Tant que je ne pointe pas sur un élément null j'incremente*/
if(a_Sessions[i]==NULL)
{/* Allocation */
a_Sessions[i] = malloc(sizeof(struct t_Session));
}
}
GLOBAL p_Sessions a_Sessions
= {
{ NULL } /* 1rst instance */
,{ NULL } /* 2nd instance */
,{ NULL } /* 3rd instance */
,{ NULL } /* 4th instance */
,{ NULL } /* 5th instance */
,{ NULL } /* 6th instance */
,{ NULL } /* 7th instance */
,{ NULL } /* 8th instance */
,{ NULL } /* 9th instance */
,{ NULL } /* 10th instance */
} |
Partager