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

27 lines
425 B
C
Raw Normal View History

#include <stdio.h>
#include <stdarg.h>
#include <string.h>
char msgbuf[80];
char *fmtmsg( char *format, ... )
{
va_list arglist;
va_start( arglist, format );
strcpy( msgbuf, "Error: " );
_vbprintf( &msgbuf[7], 73, format, arglist );
va_end( arglist );
return( msgbuf );
}
void main()
{
char *msg;
msg = fmtmsg( "%s %d %s", "Failed", 100, "times" );
printf( "%s\n", msg );
}