An enumerations value in no way needs to be unique:
#include <stdlib.h> /* for EXIT_SUCCESS */
#include <stdio.h> /* for printf() */
enum Dupes
{
Base, /* Takes 0 */
One, /* Takes Base + 1 */
Two, /* Takes One + 1 */
Negative = -1,
AnotherZero /* Takes Negative + 1 == 0, sigh */
};
int main(void)
{
printf("Base = %d\n", Base);
printf("One = %d\n", One);
printf("Two = %d\n", Two);
printf("Negative = %d\n", Negative);
printf("AnotherZero = %d\n", AnotherZero);
return EXIT_SUCCESS;
}
The sample prints:
Base = 0
One = 1
Two = 2
Negative = -1
AnotherZero = 0