Can we change the value content of a enum

Can we change the value content of a enum afterward?

enum Val : int { a, b, c }

//...

Val a = (Val)3 ;

how do we do it ?
to change a from 0 to 3, or other number, of any kind of type?

Thanks much before.
1
2
3
4
5
6
7
8
9
10
11
12
// each enumerator like RED or GREEN is a named constant;
// its value can't be changed except by modifying the source code and re-compiling
enum colour { RED=16, GREEN=32, BLUE=64, WHITE=RED+GREEN+BLUE, GREY=WHITE/2, BLACK=0 };

int main()
{
    colour clr_sky = BLUE ; // clr_sky is a non-const variable of type colour
                            // the value of the object can be changed

    bool rainy = true ;
    if(rainy) clr_sky = GREY ; // change the value of clr_sky
}
Topic archived. No new replies allowed.