ILE C/C++ Run-Time Library Functions


wprintf() -- Format Data as Wide Characters and Print

Format

#include <stdio.h>
int wprintf(const wchar_t *format,...);

Language Level: ANSI

Threadsafe: Yes.

Description

A wprintf(format, ... ) is equivalent to fwprintf(stdout, format, ... ).

Note:
This function is available when SYSIFCOPT(*IFSIO) is specified on the compilation command, and LOCALETYPE(*CLD) is not specified on the compilation command.

Return Value

The wprintf() function returns the number of wide characters transmitted. If an output error occurred, the wprintf() function returns a negative value.

Example that uses wprintf()

This example prints the wide character a. Date and time may be formatted according to your locale's representation. The output goes to stdout.


#include <wchar.h> 
#include <stdarg.h> 
#include <locale.h> 
 
int main(void) 
 
{ 
   setlocale(LC_ALL, "POSIX"); 
   wprintf (L"%c\n", L'a'); 
   return(0); 
} 
 
 /* A long 'a' is written to stdout  */ 

Related Information


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]