Solved

Borlan c++ ttime

Posted on 2000-02-22
3
365 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

786 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