Wrapper function to sprintf
Robert E. Novak
rnovak at pyrnova
Tue Mar 1 04:09:27 AEST 1988
In article <232400003 at prism> atj at prism.UUCP writes:
>Hi, I am having a little problem with developing a "wrapper" to sprintf.
>What I wish to do is write a "dialog_box" routine that takes the
>same parameters as printf. So, I have the following:
>dialog_box(cs, args)
>char *cs;
>{
> char buffer[512];
> sprintf(buffer, cs, args);
>}
>/* anything obviously wrong with this? */
>
>What happens is that only the first arg is formatted correctly.
>This is on a Pyramid 9820, OSx 4.0 (BSD universe)
>Thanks.
>Alex T. Jenkins
>Mirror Systems, Cambridge Massachusetts atj at mirror.TMC.COM
VARARGS(3-ucb) Pyramid OSx Operating System VARARGS(3-ucb)
NAME
varargs - variable argument list
SYNOPSIS
#include <varargs.h>
function(va_alist)
va_dcl
va_list pvar;
va_start(pvar);
f = va_arg(pvar, type);
va_end(pvar);
DESCRIPTION
This set of macros provides a means of writing portable pro-
cedures that accept variable argument lists. Routines hav-
ing variable argument lists (such as printf(3)) that do not
use varargs are inherently nonportable, since different
machines use different argument passing conventions.
More information about the Comp.sys.pyramid
mailing list