How Enumeration datatype is stored in memory?Is enum really stored in memory in stack?How each value of enum is accessed?
i have gone through many blogs stating that
enums are not allocated in memory - they exist only on compilation stage. They only exist to tell compiler what value is Tuesday in ur example. When code runs - there is no enums there anymore.
It does same thing as below
#define Monday 0;
#define Tuesday 1;
.
.
.
.
#define Sunday 6;
But we prefer enums than define because easier to support and read the code with enums then with #defines.
u can get clarity of enum size by this Stackoverflow answer