beautypg.com

Input/output

Page 347

background image

UM014423-0607

C Standard Library

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

327

A function can be called with a variable number of arguments of varying types. “Function
Definitions” parameter list contains one or more parameters. The rightmost parameter
plays a special role in the access mechanism and is designated parmN in this description.

Type

Variable Argument List Access Macros and Function

The va_start and va_arg macros described in this section are implemented as macros, not
as real functions. If

#undef

is used to remove a macro definition and obtain access to a

real function, the behavior is undefined.

Functions

Input/Output

The <

stdio.h

> header declares input and output functions.

Macro

Functions

Formatted Input/Output

va_list

An array type suitable for holding information needed by the macro va_arg and the
function va_end. The called function declares a variable (referred to as ap in this
section) having type va_list. The variable ap can be passed as an argument to another
function.

void va_start(va_list ap, parmN);

Sets pointer to beginning of argument list.

type va_arg (va_list ap, type);

Retrieves argument from list.

void va_end(va_list ap);

Resets pointer.

EOF

Expands to a negative integral constant. Returned by functions to indicate end of
file.

int printf(const char *format, ...);

Writes formatted data to stdout.

int scanf(const char *format, ...);

Reads formatted data from stdin.

int sprintf(char *s, const char *format, ...);

Writes formatted data to string.

int sscanf(const char *s, const char *format, ...);

Reads formatted data from string.

int vprintf(const char *format, va_list arg);

Writes formatted data to a stdout.

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

Writes formatted data to a string.

This manual is related to the following products: