Énumérations » Historique » Version 3
Patrice Nadeau, 2025-03-23 10:51
| 1 | 1 | Patrice Nadeau | # Énumérations |
|---|---|---|---|
| 2 | 2 | Patrice Nadeau | DOIT être utilisée pour définir une série de valeurs. |
| 3 | 1 | Patrice Nadeau | |
| 4 | ## Exemple |
||
| 5 | ```c |
||
| 6 | /** |
||
| 7 | * @brief Liste des valeurs STATUS |
||
| 8 | */ |
||
| 9 | enum STATUS_LIST { |
||
| 10 | /** @brief Le processus est OK */ |
||
| 11 | STATUS_OK = 0, |
||
| 12 | /** @brief Le processus est en cours d'initialisation */ |
||
| 13 | STATUS_INIT, |
||
| 14 | /** @brief Le processus est arrêté */ |
||
| 15 | STATUS_HALTED |
||
| 16 | }; |
||
| 17 | ``` |
||
| 18 | |||
| 19 | ## Justifications |
||
| 20 | * Permet l’utilisation dans une boucle avec des valeurs prédéfinis |