When I convert enum to integer type, what can I expect?
Does the first variant have value of 0?
Does the variant ordinal number increment by 1?
Assume that I did not explicitly provide the values.
If you like code, then the questions are here:
enum foo
{
A,
B,
};
int
main(void)
{
assert(A == 0);
assert(B == 1);
}
Yes.
Yes.
From https://port70.net/~nsz/c/c11/n1570.html#6.7.2.2 :