#include // tipo "Cor" typedef enum { BLACK, BLUE, GREEN, RED, YELLOW, WHITE } Color_t ; // define o nome da cor char* color_name (Color_t c) { switch (c) { case BLACK : return ("black") ; case BLUE : return ("blue") ; case GREEN : return ("green") ; case RED : return ("red") ; case YELLOW : return ("yellow") ; case WHITE : return ("white") ; default : return ("") ; } } int main () { Color_t c1; // ... c1 = BLUE ; printf ("Cor %s\n", color_name(c1)) ; }