Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Enumerations in C
#1
Enumerations define a set of named constants.

enum Color {
    RED,
    GREEN,
    BLUE
};

int main() {
    enum Color color = GREEN;
    if (color == GREEN) {
        printf("Color is Green\n");
    }
    return 0;
}
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)