How enum constants are processed in a C program. I know these constants are not stored in memory. So I wonder how during execution our program refers any enum constant.
enum data
{
first_value = 100,
second_value = 200
};
enum data value;
During execution how "first_value" or "second_value" is referred if they are not in memory?
int x = first_value;after compilation becomemov dword ptr [esp+1Ch], 64h(this assembly command moves immediate64h = 100 = first_valueto memory address that correspondxvariable). As you can seefirst_valuebuilt in the assembly instruction. Note: also your variablevaluenot initialized and can be equal anything.