Compare data and time with the current and future data c+

[CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE] [CLOSE]
Last edited on
date and time is aggravating.
like any code, though, unravel it with more code:


if(mm < nowLocal.tm_mon+1 && dd < nowLocal.tm_mday)
cout << "true 1" << endl;

if(yyyy < nowLocal.tm_year+1900)
cout << "true 2" << endl;

some prints like that should quickly let you find any logic errors as you exercise it.

unrelated but this is a classic case of why do-while exists rather than duplicate code.
Last edited on
Topic archived. No new replies allowed.