I have two enums in my code:
enum Month {January, February, March, April, May, June, July,
August, September, October, November, December};
enum Shor
My suggestion here is to have just one enum, as they are the same type. If you want short aliases to type less in your code (even if I wouldn't advise you to do so), you can do:
enum Month {
January, Jan = January,
February, Feb = February,
March, Mar = March,
April, Apr = April
May,
June, Jun = June,
July, Jul = July,
...};
And to have different presentation names (short and long), you should have two distinct string arrays that are indexed by the enum.
char[MAX_MONTH_NAME_LENGTH][12] month_long_names = {
"January", "February", ...
}
char[3][12] short_long_names = {
"Jan", "Feb", ...
}
printf("month %d long name is %s, and short name is %s\n", May, long_month_names[May], short_month_names[May]);