what is the default value of enum variable?

c, c++, enums

Solution

It's uninitialized and undefined behavior to read the value.

Just like saying

int x;

`x` doesn't have a value until you initialize it.

Problem

I have a question about enum variable in c++: ``` type enmu { DAY1 = 1, DAY2, DAY3, DAY4 } DAYS; void main() { DAYS days; } ``` then what is the default value of days?

Original source

Related problems