I am running into an odd issue. G++ tells me a warning, warning: control reaches end of non-void function [-Wreturn-type].
Any thoughts? My code is below, and it seems to me that it will always return something...
The if statement on line 3 has no else, even though this might logically never happen, the compiler sees it as a possible path.
But your code is too complex IMO. Consider having a IsLeapYear function - a one liner; and use a vector for the months and the number of days they have - the subscript is the month number.
I see what youre saying about the pseudocode, but I think I need to do it like this:
1 2 3 4
if (mm == 2)
elseif (mm == 4 || mm == 6 || mm == 9 || mm == 11)
elseif (mm == 1 || mm == 3 || mm == 5 || mm == 7 || mm == 8 || mm == 10 || mm == 12)
else
Does it sound feasible to you?
TheIdeasMan, we have not learned vectors yet, thank you for your input.