help with enum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Experts,
I was wondering if anyone could please tell me how to
set the size of a enum type. I think by default it is
long (4 bytes). I need to change it for a different
size, for example to int(2 bytes). 

typedef enum {sun=30000, mon, tues, wed, thurs} eTest;
int main(void)
{
	printf("Size is %d",sizeof(eTest));
	return 0;	
}

right now it would print out "Size is 4". I need to
configure it so that it treats enum as a 2 byte int,
therefore print "Size is 2".

Thanks in advance for your help
Raman

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux