As i read size of enum is sufficient enough to hold any integer value,thus its 4 bytes in my machine.
So,enum variable gets sizeof(int),i can even access any of its member directly by name,but i cant print there addresses.?
Code:
typedef enum{ Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }weekday; void main() { weekday day=Tuesday; printf("%d\n",day);// prints 1,correct printf("%d\n",Wednesday);//Prints 2!How do i have access to this?It prints the correct value //But when i am traying to print the address of the following printf("%p\n",&day);//prints some address,correct //printf("%p\n",&Wednesday);if i try to print this it says 'lvalue required as unary ‘&’ operand' } ~ ~
Comment