home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / proglc / timeutil.lzh / TIMECHK.C next >
Encoding:
C/C++ Source or Header  |  1988-04-08  |  451 b   |  21 lines

  1. /*  TIMECHK.C - Sets the DOS errorlevel to the hour + 200.  */
  2.  
  3. #include <stdio.h>
  4. #include <dos.h>
  5.  
  6. main()
  7. {
  8.     struct time dostime;
  9.         int    errorlevel;
  10.  
  11.         errorlevel = 0;
  12.     gettime(&dostime);
  13.  
  14.     errorlevel = (dostime.ti_hour * 10) + (dostime.ti_min / 10);
  15.  
  16.     printf("\nThe time is %02d:%02d:%02d\n",
  17.              dostime.ti_hour, dostime.ti_min, dostime.ti_sec);
  18.     printf("Errorlevel = %03d\n", errorlevel );
  19.  
  20.     exit(errorlevel);
  21. }