Jump to content

C Programming/stdio.h/fwprintf

From Wikibooks, open books for an open world

fwprintf is a C standard library function as defined in wchar.h. The required headers are whar.h and stdio.h. It is the wide character version of fprintf. It's function signature is

int fwprintf(FILE *fp, const wchar_t *format, argument list);

In signature of the fwprintf, fp is a stream to which you want to send output. format is wide character stream that specifies the format of output.The formatting string takes care of additional arguments you need to provide.

Usage

[edit | edit source]

fwprintf puts output on the named output stream. fwprintf performs wide character output to stream and this stream is not byte oriented The fwprintf is the function which converts all the arguments specified in the argument list in accordance with wide character format specifier in format.The fwprintf() function writes output to the stream ,under control of the wide string pointed to by format.

Format

[edit | edit source]

fwprintf() function can convert, print and format its arguments in the parenthesis which converts the format wide characters string. Here the format consists of either numbered argument specifications such as "%n$"and "*m$" or unnumbered arguments conversion specifiers such as % and *.But both cannot be.

Return

[edit | edit source]

fwprintf returns the number of wide characters used excluding the NULL character. If an error occurs ,it returns a negative number.