•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 392,075 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,082 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:
Views: 1342 | Replies: 1 | Solved
![]() |
•
•
Join Date: Oct 2006
Location: New York City
Posts: 2,553
Reputation:
Rep Power: 7
Solved Threads: 1
I am planning to implement #include <time.h> in my program. I have never yet used this include. I will be using this in order to track a 24-hour period, or at least that is what I wish to do; I basically need to set up a natural 24-hour day that I will be able to access and use at different, undetermined points in time, like a standard, analog clock-- I will need to be able to "tell the time". I will be using this time (when accessed) in a control statement. It would be great if is simply a variable that I would be accessing or if it could be dumped into a variable for use.
I am not asking for help with the program (design, logic, etc). I simply am seeing if anyone would be kind enough to share any thoughts, warnings, hazards, or general concerns about using time.h in a C++ program. Perhaps time.h is the incorrect include for what I am seeking to do?
Thank-you in advance for any reply.
[EDIT] With further thought, the tracking of the 24-hours in a direct, static sense would only last for the life of the program at the most (?) The program runs -> Time data saved in a variable would be active here -> This data would be dumped at program end. I suppose I will somehow have to make use of the system time for this-- perhaps I will just have to simulate the 24-day by using 24-milliseconds. Perhaps a RNG instead which provides a integer representing a specific hour? Actually, the user will not know and truthfully it should not matter how I do this-- the program is a simulator of sorts, so in essence, all is faked. Just thinking.
I am not asking for help with the program (design, logic, etc). I simply am seeing if anyone would be kind enough to share any thoughts, warnings, hazards, or general concerns about using time.h in a C++ program. Perhaps time.h is the incorrect include for what I am seeking to do?
Thank-you in advance for any reply.
[EDIT] With further thought, the tracking of the 24-hours in a direct, static sense would only last for the life of the program at the most (?) The program runs -> Time data saved in a variable would be active here -> This data would be dumped at program end. I suppose I will somehow have to make use of the system time for this-- perhaps I will just have to simulate the 24-day by using 24-milliseconds. Perhaps a RNG instead which provides a integer representing a specific hour? Actually, the user will not know and truthfully it should not matter how I do this-- the program is a simulator of sorts, so in essence, all is faked. Just thinking.
Last edited by mattyd : Nov 1st, 2006 at 6:47 pm. Reason: -
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb C++ Marketplace
- Favorite All Time Games (Geeks' Lounge)
- mIRC or Real Time Message Boards...in Linux (*nix Software)
- cts time out (Windows NT / 2000 / XP / 2003)
- Slowed Boot Time and Internet Connection Time. (Windows NT / 2000 / XP / 2003)
- Time out web pages w/text or drop boxes (Networking Hardware Configuration)
- Windows 95/98/98SE/MM = Time To UPGRADE (Windows 9x / Me)
- Run-Time Error..? (Windows NT / 2000 / XP / 2003)
- No time... bitch load of problems (Windows NT / 2000 / XP / 2003)
Other Threads in the C++ Forum
- Previous Thread: trying to get the second 2nd value of same key in multimap
- Next Thread: Get and set method... I am confuse.



Linear Mode