I run into a problem using enum datatype with printf statement. The folloing code works with Viusal C but does not work with KEIL compiler --- printf statement prints out the wrong value. Could somebody in this forum tell me what I did wrong here? --- here is the test code
enum MONTHS {JAN=1,FEB,MAR,APR,MAY,JUN,JUL, AUG,SEP,OCT,NOV,DEC} birthday; void main(void) { birthday = NOV; printf("\n\r\ My birthday = %d", birthday); }