This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/vcprintf.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( &ltime );
_localtime( &ltime, &time_of_day );
tprintf( 12, 1, "Date and time is: %s\n",
_asctime( &time_of_day, buf ) );
}