RtWprintf

RtWprintf prints formatted output to the standard output stream or console window.

Syntax

Copy
INT RtWprintf(
    const WCHAR *fmt [, argument, . . .]
);

Parameters

lpFormat

The format control with optional arguments.

Return Value

If the function succeeds, it returns the number of wide characters printed. If the function fails, it returns a negative value.

Remarks

RtWprintf is like wprintf, but RtWprintf does not require the Microsoft C Runtime library and can work with any combination of run-time libraries.

Note: This function does not support floating point conversions.

RtWprintf formats and prints a series of characters and values to the eRTOS Console. If you redirect stdout to a file with freopen, RtPrintf/RtWprintf will continue to write to the eRTOS console, but printf/wprintf (and their related APIs) will write to the file.

If arguments follow the format string, the format string must contain specifications that determine the output format for the arguments.

The format argument consists of ordinary characters, escape sequences, and (if arguments follow format) format specifications. The ordinary characters and escape sequences are copied in order of their appearance.

Format specifications always begin with a percent sign (%) and are read left to right. When RtWprintf encounters the first format specification (if any), it converts the value of the first argument after format and outputs it accordingly. The second format specification causes the second argument to be converted and output, and so on. If there are more arguments than there are format specifications, the extra arguments are ignored. The results are undefined if there are not enough arguments for all the format specifications.

Requirements

Minimum supported version Header Library

eRTOS 1.0 SDK

Rtapi.h rtkrnl.lib

 

Example

Copy
RtWprintf(L"Line one\n\t\tLine two\n");

produces the output:

Copy
Line one
  Line two

Format Specification Fields

See the format specification fields in the Remarks section of RtPrintf for details.

See Also: