cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Show DATE
Show DATE
May 15, 2016 at 11:02pm UTC
romasasss
(3)
Hello guys. I'm am new at C++ and maybe someone can help me with this task?
TASK:
I have two dates (year, month, day). I have to write a program, which shows, which
date is later.
And i don't understand how to make that if i have date in form like this with comma : 2016,05,01
Thank you in advance.
Last edited on
May 15, 2016 at 11:15pm UTC
May 16, 2016 at 8:33am UTC
Thomas1965
(4571)
First you need to convert your string into int variables - probably with a stringstream.
The you can use mktime to create 2 time variables.
Finally you compare the two variables.
http://www.cplusplus.com/reference/sstream/stringstream/
http://www.cplusplus.com/reference/ctime/mktime/
Topic archived. No new replies allowed.