The
ValidDate
function is obviously not doing what it should do. Using indenting you should see it (and your compiler should also show a warning when set to higher warning level):
bool correctFormat = false;
if (dates[2] == '/' && dates[5] == '/' && length == 10)
if (correctFormat == true);
return correctFormat;
The names of the
ValidDate
and
ValidFormat
functions are interchanged (each does the job of the other).
Your leap year calculation is not correct. There are special rules for every 100th and 400th year.
Overall you might think about different solutions to parts of your program. E.g. there are standard library functions to convert strings to numbers.