Interactive Computer Science Tutoring

Learn programming concepts interactively

AHA Schools Logo

C Enumerations - The Office Organization System

Master enum declaration, values, and state machines with visual building metaphors

Office Department Explorer
Explore different enum examples through building metaphors
Build Your Own Department
Create a custom enum with your own values
Explicit Value Assignment
See how explicit values affect automatic numbering
Name Conflict Simulator
Understand why enum names can conflict in C
Enum Mastery Challenge
Test your understanding of C enumerations
What value does CRITICAL get in the Priority enum when LOW=1, MEDIUM=5, HIGH=10?
Department Enum Code
Interactive C code with memory visualization
Office Building Visualization
Building A
Basic Office
0
SALES
Auto: 0
Auto
1
MARKETING
Auto: 1
Auto
2
HR
Auto: 2
Auto
3
ENGINEERING
Auto: 3
Auto
Enum Learning Log0/5
Recent operations with timestamps

No operations yet

Start by adding or modifying elements

Enum Best Practices
✅ Good Practices
• Use descriptive enum names (Color, not C)
• Prefix values to avoid conflicts (COLOR_RED)
• Use explicit values for public APIs
• Keep enums in header files for sharing
❌ Avoid These Mistakes
• Generic names (Status, Type)
• Negative values without purpose
• Mixing enums with integers carelessly
• Forgetting to handle all enum cases in switch
Real-World Applications
State Machines
Game states, network protocols, UI modes
Error Codes
Function return codes, API status values
Configuration Options
Log levels, optimization settings, feature flags
Bit Flags
Permission systems, feature combinations