home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / C++-7 / DISK4 / SAMPLES / CPPTUTOR / OVERLOAD.CP$ / OVERLOAD
Encoding:
Text File  |  1991-12-12  |  524 b   |  27 lines

  1. // OVERLOAD.CPP
  2.  
  3. // This is an example program from Chapter 2 of the C++ Tutorial. This
  4. //     program demonstrates overloaded functions.
  5.  
  6. #include <iostream.h>
  7. #include <time.h>
  8.  
  9. void display_time( const struct tm *tim )
  10. {
  11.    cout << "1. It is now " << asctime( tim );
  12. }
  13.  
  14. void display_time( const time_t *tim )
  15. {
  16.    cout << "2. It is now " << ctime( tim );
  17. }
  18.  
  19. void main()
  20. {
  21.    time_t tim = time( NULL );
  22.    struct tm *ltim = localtime( &tim );
  23.  
  24.    display_time( ltim );
  25.    display_time( &tim );
  26. }
  27.