lesson 12 showtime cpp
[[lesson_12_showtime_cpp]] last edit on Aug 18, 2005 6:59 AM by rescued_by_c

[user02@FC4 Lesson12]$ cat -n showtime.cpp
   1  #include <iostream>
   2  #include <ctime>      // For run-time library functions

   3  using namespace std;
   4
   5  int main()
   6  {
   7     time_t system_time;
   8
   9     system_time = time(NULL);
  10
  11     cout << "The current system time is " << ctime(&system_time) << endl;
  12
  13     return 0;
  14  }
[user02@FC4 Lesson12]$ g++ -o showtime showtime.cpp
[user02@FC4 Lesson12]$ ./showtime
The current system time is Tue Aug 9 03:36:25 2005

[user02@FC4 Lesson12]$