Solved

Borlan c++ ttime

Posted on 2000-02-22
3
347 Views
Last Modified: 2012-06-22
does anybody know how to use the ttime class and his functions?
an example would be nice.
thankx
0
Comment
Question by:klecki_2000
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 20 total points
ID: 2546613
Hi.
Usually , i reply throuh EE.
1. In you 1-st Q you must use only DOS project:
   not EasyWin,Console! Function sound() works
   only in Dos. In Windows use sndPlaySound or PlaySound
   Api.
2. TTime "suffers" form Y2K. It works before 2000 and
   don't works after! I usually use good old gettime.
   In next example gettime works(allways(, TTime: not!

void main()
{
  struct time tm;
  TTime zman;
  gettime(&tm);
  HourTy Hour = zman.Hour();
  SecondTy sec = zman.Second();
  MinuteTy Min = zman.Minute();
  printf("TTime   = %d:%d:%d\n",Hour,Min,sec);
  printf("gettime = %d:%d:%d\n",tm.ti_hour,
            tm.ti_min,tm.ti_sec);
  getch();
}
3. And my Q: i understand, that you know my EMail
  from Ediot Aharonot. Can you write exectly date and page
  of an article?
Alex
0
 

Author Comment

by:klecki_2000
ID: 2550199
Adjusted points to 22
0
 

Author Comment

by:klecki_2000
ID: 2550200
good answer and most important an excellent example.
Thank you Alex.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now