beautypg.com

Vprintf, Vsprintf, Vprintf vsprintf – Zilog EZ80F916 User Manual

Page 397

background image

UM014423-0607

C Standard Library

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

377

va_start(ap, n_ptrs);
while (ptr_no < n_ptrs)

array[ptr_no++] = va_arg(ap, char *);

va_end(ap);
f2(n_ptrs, array);

}

Each call to f1 has in scope the definition of the function of a declaration such as

void

f1(int, ...);

vprintf

Equivalent to

printf

, with the variable argument list replaced by arg, which has been ini-

tialized by the

va_start

macro (and possibly subsequent

va_arg

calls). The

vprintf

function does not invoke the

va_end

function.

Synopsis

#include
#include
int vprintf(char *format, va_list arg);

Returns

The number of characters transmitted or a negative value if an output error occurred.

Example

va_list va;
/* initialize the variable argument va here */
vprintf("%d %d %d",va);

vsprintf

Equivalent to

sprintf

, with the variable argument list replaced by arg, which has been

initialized by the

va_start

macro (and possibly subsequent

va_arg

calls). The

vsprintf

function does not invoke the va_end function.

Synopsis

#include
#include
int vsprintf(char *s, char *format, va_list arg);

Returns

The number of characters written in the array, not counting the terminating null character.

This manual is related to the following products: