swprintf

Writes output to an array of wide characters under control of the wide-character format string.

Format

#include  <wchar.h>

int swprintf  (wchar_t *s, size_t n, const wchar_t
              *format, . . . );

Arguments

s
A pointer to the resulting wide-character sequence.
n
The maximum number of wide characters that can be written to an array pointed to by s, including a terminating null wide character.
format
A pointer to a wide-character string containing the format specifications. For more information about format and conversion specifications and their corresponding arguments, see Chapter 2.
. . .
Optional expressions whose resultant types correspond to conversion specifications given in the format specification.

If no conversion specifications are given, the output sources can be omitted. Otherwise, the function calls must have exactly as many output sources as there are conversion specifications, and the conversion specifications must match the types of the output sources.

Conversion specifications are matched to output sources in left-to- right order. Excess output pointers, if any, are ignored.

Description

The swprintf function is equivalent to the fwprintf function, except that the first parameter specifies an array of wide characters instead of a stream.

No more than n wide characters are written, including a terminating null wide character, which is always added (unless n is 0).

See also fwprintf in this section.

Return Values
The number of wide characters written, not counting the terminating null wide character. 
Negative value  Indicates an error. Either n or more wide characters were requested to be written, or a conversion error occurred, in which case errno is set to EILSEQ.  


Previous Page | Next Page | Table of Contents | Index