开发者

How to extract information from command prompt, working with c++?

开发者 https://www.devze.com 2023-02-09 03:55 出处:网络
i wanna make a program on c++ that tells you how many days, years and months need to pass to get to a certain date. Also i wanna include how many hours and minutes need to pass.

i wanna make a program on c++ that tells you how many days, years and months need to pass to get to a certain date. Also i wanna include how many hours and minutes need to pass. So my problem is that开发者_高级运维 i do not know how to get the current date and time to a variable from the command "time" on cmd or anyway to get the current date date and time so it will work. I accespt the program done already so i can see it and end my doubts.


http://www.cplusplus.com/reference/clibrary/ctime/


  1. Get input with getline()
  2. Parse string to date format
  3. Use some time/data library to find the difference
  4. Output to console


While this is almost certainly homework, you might find this post useful (points to the Boost library): C++ DateTime class

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号