I made 2 programs, each both use only <stdlib.h> and <stdio.h>.
I can't find any important differences in them. In the first one I did simple math problems with enum things, and it worked fine, but now in the second one, the compiler complains when i do some enum thing = 0 for example. Here is the codes from both the programs:
program 1:
Code:
//this is outside of main()
enum row {row1,row2,row3,row4,row5,row6,row7,row8,row9};
typedef enum row row;
//this is in main()
row tmprow;
for(tmprow=row1;tmprow<=row9;tmprow++)
{}
program 2:
Code:
//this is outside of main()
enum country {italy, america, france, brazil, england, newzealand, nepal, switzerland, canada, australia};
typedef enum country country;
//this is in main()
country tmpcountry;
for(tmpcountry=0;tmpcountry<=9;tmpcountry++)
{}
In the first program my compiler is happy, but in the second one, he complains about each of the 3 parts of the for statement. What did I do wrong? How do I fix the 2nd program? Thanks for the help