A pointer to a read-only wide-character string, where each character is of type `wchar_t`. Used for representing text in wide-character encoding to support extended character sets, such as Unicode. The string is null-terminated, with the terminator being a `wchar_t` with value 0.
1st Parameter
Pointer to a null-terminated wide-character string specifying the format of the output. It may include format specifiers like `%ls`, `%d`, etc.
2nd Parameter Type : ...
Represents a variable number of arguments in a function. Used in functions like `printf` or `fprintf` to accept additional parameters beyond those explicitly declared.
2nd Parameter
Additional arguments providing the values to format and write according to the format string.
Read more about parameters of wprintf in parameters section
The wprintffunction in C language Prints formatted wide character output to the standard output.
wprintf writes the wide string pointed to by format to the standard output (stdout). If format includes format specifiers (beginning with %), the additional arguments following format are formatted and inserted in the resulting wide string replacing their respective specifiers.
The wprintffunction takes 2
parameters:
•
const wchar_t * `format`: Pointer to a null-terminated wide-character string specifying the format of the output. It may include format specifiers like `%ls`, `%d`, etc.
•
... `args`: Additional arguments providing the values to format and write according to the format string.
Writes a formatted wide-character string to the standard output (`stdout`). Returns the number of wide characters written, or a negative value if an error occurs.
The wprintf function return value :
Returns the number of wide characters written, or a negative value if an error occurred
Output
This example demonstrates the basic usage of wprintf to print a wide character string and an integer.