28 lines
550 B
C
28 lines
550 B
C
#include <conio.h>
|
|
#include <stdarg.h>
|
|
#include <time.h>
|
|
|
|
#define ESCAPE 27
|
|
|
|
void tprintf( int row, int col, char *format, ... )
|
|
{
|
|
auto va_list arglist;
|
|
|
|
cprintf( "%c[%2.2d;%2.2dH", ESCAPE, row, col );
|
|
va_start( arglist, format );
|
|
vcprintf( format, arglist );
|
|
va_end( arglist );
|
|
}
|
|
|
|
void main()
|
|
{
|
|
struct tm time_of_day;
|
|
time_t ltime;
|
|
auto char buf[26];
|
|
|
|
time( <ime );
|
|
_localtime( <ime, &time_of_day );
|
|
tprintf( 12, 1, "Date and time is: %s\n",
|
|
_asctime( &time_of_day, buf ) );
|
|
}
|