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.
Hi Folks, I am trying to use enum to define a set of named constants with values so that they can be used by multiple C files in my project. For example. I use the following snipet to define Months in a headers file externals.h, and then If I then try to use it as follows in any of those files, it does not work.
enum MONTHS {M1 = 'Jan', M2 = 'Feb', M3 = 'Mar'}; .... .... extern enum MONTHS; // should it be extern enum MONTHS months; ? .... ..... SendByte (M1);//(This routine display M1 on my serial port).
I get error ---> (...error 230 MONTH unknown struct/union/enum tag)
What is the problem and how can I fix it ? I would like to get a better understanding of this enum business, if possible..
Thanks.
Bhal Tulpule