If I compile your code at the maximum warning level
/W4, which you should always do, I get a
warning C4100: 'wadges' : unreferenced formal parameter relative to the line:
void setwadges(int wadges){}
Fix it and
initialize your variables, things should become clearer to you.
BTW what do you intend with:
int hours[max_hours];
?
cheers,
AR