How do you make a clock that runs in dos(The clocks time the same as the computers time)?
How do you make a clock that runs in dos(The clocks time the same as the computers time)?
Very lame Windows-specific method:
Code:#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char *argv[]) { while (true) { time_t curr = time(0) ; cout << "Time: " << ctime(&curr) << endl ; Sleep(1000) ; system("cls") ; } system("PAUSE"); return 0; }
There is some information in the Programming FAQ that should be helpful.