Affectation structure

Résolu
didy_gwatinik Messages postés 358 Statut Membre -  
didy_gwatinik Messages postés 358 Statut Membre -
Bonjour,
J'ai un probleme :
l'affectation de structure avec = ne marche pas, y-a-t-il un autre moyen pour faire :
tab[i].nom=tab[*nbContact].nom);               
tab[i].prenom=tab[nbContact].prenom;                  
tab[i].numTel=tab[nbContact].numTel;
tab[i].mel=tab[nbContact].mel;

????
Configuration: Windows XP
Internet Explorer 7.0

1 réponse

  1. mype Messages postés 2459 Date d'inscription   Statut Membre Dernière intervention   437
     
    si ce sont des caracteres utilise strcpy()
    0
    1. didy_gwatinik Messages postés 358 Statut Membre 80
       
      Ce sont des chaines de caracteres j'obtiens l'erreur suivante : invalid types `carnet[10][int*]' for array subscript
      Voila ce que j'ai tapé :
      strcpy(tab[i].nom,tab[nbContact].nom);
      strcpy(tab[i].prenom,tab[nbContact].prenom);
      strcpy(tab[i].numTel,tab[nbContact].numTel);
      strcpy(tab[i].mel,tab[nbContact].mel);
      0
    2. didy_gwatinik Messages postés 358 Statut Membre 80
       
      J'avais oublié les * devant nbContact!
      Merci pour l'aide en tout cas!
      0