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/va_end.c

31 lines
603 B
C

#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#define ESCAPE 27
void tprintf( int row, int col, char *fmt, ... )
{
auto va_list ap;
char *p1, *p2;
va_start( ap, fmt );
p1 = va_arg( ap, char * );
p2 = va_arg( ap, char * );
printf( "%c[%2.2d;%2.2dH", ESCAPE, row, col );
printf( fmt, p1, p2 );
va_end( ap );
}
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 ) );
}