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

24 lines
467 B
C

#include <stdio.h>
#include <stdarg.h>
void sfind( char *string, char *format, ... )
{
va_list arglist;
va_start( arglist, format );
vsscanf( string, format, arglist );
va_end( arglist );
}
void main()
{
int day, year;
char weekday[10], month[12];
sfind( "Saturday April 18 1987",
"%s %s %d %d",
weekday, month, &day, &year );
printf( "\n%s, %s %d, %d\n",
weekday, month, day, year );
}