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
|
int TableauDynamique_struct_ajouter(struct tableauDynamique_int *pThis,char *seq,char *pMotGauche,char *pMotDroit))
{
// ...
/* ajouter */
{
Dsequence ds;
ds.p2seq = malloc ( strlen(seq) * sizeof(char) );
if ( ds.p2seq == NULL )
{
return -1;
}
strcmp(ds.p2seq, p2seq);
ds.pMotGauche = malloc ( strlen(pMotGauche) * sizeof(char) );
if ( ds.pMotGauche == NULL )
{
return -1;
}
strcmp(ds.pMotGauche, pMotGauche);
ds.pMotDroit = malloc ( strlen(pMotDroit) * sizeof(char) );
if ( ds.pMotDroit == NULL )
{
return -1;
}
strcmp(ds.pMotDroit, pMotDroit);
pThis->tab[ pThis->taille++ ] = ds;
}
} |
Partager