logo

Introduction to Enumerations in C

#include <stdio.h> #include <stdlib.h> #include <string.h> enum Color { RED = 4, BLUE, YELLOW }; typedef enum Color Color; int main(int argc, char* argv[]) { Color c = YELLOW; printf("%d\n", c); return 0; }

Courses with this lesson