We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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); }