Как в сях перечислить константы? Например нужно сделать так: A = 1 B = 2 C = 3 ... Если какие-то варианты, кроме дефайна?
enum LETTERS { A = 1, B, C }; enum [tag] {enum-list} [declarator]; // for definition of enumerated type enum tag declarator; // for declaration of variable of type tag The enum keyword specifies an enumerated type. An enumerated type is a user-defined type consisting of a set of named constants called enumerators. By default, the first enumerator has a value of 0, and each successive enumerator is one larger than the value of the previous one, unless you explicitly specify a value for a particular enumerator. Enumerators needn’t have unique values. The name of each enumerator is treated as a constant and must be unique within the scope where the enum is defined. An enumerator can be promoted to an integer value. However, converting an integer to an enumerator requires an explicit cast, and the results are not defined. In C, you can use the enum keyword and the tag to declare variables of the enumerated type. In C++, you can use the tag alone.