Enumeration c++

Résolu/Fermé
gilles81 Messages postés 67 Date d'inscription mardi 20 mai 2008 Statut Membre Dernière intervention 29 juillet 2009 - 7 nov. 2008 à 12:01
kilian Messages postés 8731 Date d'inscription vendredi 19 septembre 2003 Statut Modérateur Dernière intervention 20 août 2016 - 7 nov. 2008 à 14:29
c++ énumération

salut ,
je reformule ma question.Je dispose d'une clase CSpieler ayant les attributs suivants:

char vorname[cMaxStrLength];
char nachname[cMaxStrLength];
char geboren[cMaxStrLength];
unsigned int groesse_cm;
unsigned int gewicht_kg;
unsigned int aktNummer;
char aktVerein[cMaxStrLength];
unsigned int aktVereinSeit_jahr;
E_POSITION aktPosition;

et une énumeration enum E_POSITION {Torwart, Abwehr, Mittelfeld, Sturm};

j'ai initialisé certains de ces attributs dans le constructeur:

CSpieler::CSpieler(char* vor, char* nachname, char* geboren, unsigned int groesse, unsigned int gewicht){
cMaxStrLength=20;
strncpy(vor,vorname,cMaxStrLength);
groesse_cm=groesse;
gewicht_kg =gewicht;
}

et pour d'autres tel que aktPosition je veux utiliser une setméthode:
bool SetPosition(E_POSITION position)

1 réponse

kilian Messages postés 8731 Date d'inscription vendredi 19 septembre 2003 Statut Modérateur Dernière intervention 20 août 2016 1 527
7 nov. 2008 à 14:29
Merci de continuer sur le sujet initial.
0