I am having problems with this program. I keep on getting the following error messages:
testing.c: In function `next_month':
testing.c:25: error: parameter name omitted
testing.c:27: error: syntax error before "mnth"
My code is:
Expand|Select|Wrap|Line Numbers
- #include <stdio.h>
- enum month {jan=0, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec};
- typedef enum month mnth;
- mnth next_month(int);
- int main(void)
- {
- int x;
- mnth k;
- printf("Enter. ");
- scanf("%d", x);
- k = (next_month(x));
- printf("%s", k);
- return 0;
- mnth next_month(int)
- {
- return ((mnth) (((int) mnth +1 % 12));
- }