I understand that I need to initialize the variable daysInMonth, but I don't know how to since it's value at the point where I need it to determine the validity of the day is dependent on the user's input.
int daysInMonth; //number of days in month read in
part of code that determines daysInMonth
if(month == 1)
daysInMonth = 31;
code where I get the error
//User number of days in month to check to see if day is valid
if(day > 0 && day <= daysInMonth)
dayValid = true;
else
dayValid = false;