Saturday, May 22, 2010

Is there a detailed Time.h class explanation?

I'm relatively new to OOP, and was curious if someone could point me to a resource on the functions of the Time.h class in the C++/Dev-Cpp standard library, and how to use them. I want to write a program that reads the system time on (preferably) a remote computer on a LAN, but will be content if it would read the system time from the computer from which it is running. he program need to take a snapshot of the current time immediately after the user inputs a certain integer. I want to store these time to an array in a form (possibly a struct) so that I can manipulate it (add, subtract recall) it later. Any ideas?

Is there a detailed Time.h class explanation?
http://www.cplusplus.com/reference/clibr...


Google, as usual, is online 24/7 and is *very* useful.





Not sure what time.h has to do with OOP. Am I missing something here?





%26gt; I want to write a program that reads the system time on (preferably) a remote computer on a LAN


Not possible. Unless the remote computer broadcasts the system somehow, which doesn't really happen unless it happens to be a NTP server.





Look at the link I showed above. http://Cppreference.com also works.





Note. In C++, the header for time.h is ctime. #include %26lt;ctime%26gt;
Reply:This is as good as you will get it





http://en.wikipedia.org/wiki/Time.h





and since you want to use OOP, use a class instead of a structure.


1 comment:

  1. i want to write the time the user spend on solving the puzzle game?

    ReplyDelete