answersLogoWhite

0


Best Answer

#include<iostream>

#include<time.h>

#include<string.h>

#include<sys/timeb.h>

int main()

{

char buff[2][128];

_tzset();

while (true)

{

_strtime_s (buff[0], 128);

std::cout << "\rOS time: " << buff[0];

do {

_strtime_s (buff[1], 128);

} while (strcmp (buff[0], buff[1]) == 0);

}

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Demonstrate a C plus plus program that displays a real time clock.?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you write a C plus plus program that displays a pyramid of Xes on the screen using a for loop?

printf ("x")


Create a c plus plus program that displays odd numbers between 15 and 30?

for (int i = 15; i &lt; 30; i += 2) cout &lt;&lt; i &lt;&lt; endl;


What does no plus clock plus like plus the plus?

my balls


Program in TI Basic for the 15 MHz Z80 instead of for the 6 MHz Z80?

The TI-83 Plus has a clock speed of 6MHz. The newer TI-83 Plus Silver Edition and the entire TI-84 Plus series have a 15MHz clock speed, but usually run at 6MHz for compatibility with the older 83+. Assembly programmers can switch between the two speeds with a simple command. Unfortunately, BASIC programmers can not. They can use an assembly program that will do it for them, though.


How to restart c plus plus program?

Exit the program and relaunch it.


Is there an answer book for the A plus program?

The A Plus Program is an initiative, not a test. So no, there is no answer book.


Can you program games with c plus plus?

Yes, you can program games with C++.


How do you write a program in C plus plus that displays a breakdown of words?

Parse the text, one word at a time. Convert the word to lowercase if necessary, than push the word onto a set, using the word as the key. When complete, the set will contain only the unique words.


What is a Trojan avalert?

Trojan.avalert is a Trojan Horse program that displays fake Windows and antivirus security messages plus links to websites that are corrupted. From what I have read from the Norton Security Community forums, Norton cannot remove Trojan.avalert.


When is it that 8 plus 6 equals 2?

When you look at a clock.


Why does sometimes when you run a program it will execute the previous program instead the current open program in C plus plus?

Because you aren't careful enough.


What is the only function all C plus plus programs must contain?

Every C plus plus program that is a main program must have the function 'main'.