I have the following code:
enum e {
X=1,
Y,
Z
}
What will be the values of enum elements if the first one is defined to 1?
Will the other elements be incremented by 1 each one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As everyone else is saying, the answer is yes. Here’s the standard’s way of saying that.
C99 Specification. Section 6.7.2.2 Enumeration specifiers. Paragraph 3