User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Oct 2006
Location: New York City
Posts: 2,553
Reputation: mattyd is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 1
Featured Poster
mattyd's Avatar
mattyd mattyd is offline Offline
Posting Maven

time.h

  #1  
Nov 1st, 2006
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.
Last edited by mattyd : Nov 1st, 2006 at 6:47 pm. Reason: -
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2005
Location: Tokyo, Japan
Posts: 1,480
Reputation: WolfPack has a spectacular aura about WolfPack has a spectacular aura about WolfPack has a spectacular aura about 
Rep Power: 8
Solved Threads: 98
Moderator
WolfPack's Avatar
WolfPack WolfPack is online now Online
Mentally Challenged Mod.

Re: time.h

  #2  
Nov 1st, 2006
Looks like you will be better off using one of the functions given in this page. All the info you need to use those functions are also given there. So nothing to worry about.
バルサミコ酢やっぱいらへんで
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb C++ Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the C++ Forum

All times are GMT -4. The time now is 12:13 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC