INtime SDK Help
printf, wprintf, printf_s, wprintf_s
Sections in this topic:

Syntax

Prints formatted data to stdout.

#include <stdio.h>

int printf(const char *format[, argument] ...);
int printf_s(const char *format[,argument] ...);

#include <wchar.h>

int wprintf(const wchar_t *format[, argument] ...);
int wprintf_s(const wchar_t *format[, argument] ...);

Parameters

format
Formatted string consisting of ordinary characters, escape sequences, and (if arguments follow) format specifications that determine the output format for the arguments.
argument
Optional arguments.

Remarks

The ordinary characters and escape sequences are copied to stdout in order of their appearance. For example, the line:

printf("Line one\n\t\tLine two\n");

produces the output:

Line one
    Line two

Format specifications always begin with a percent sign (%) and are read left to right. When printf encounters the first format specification, it converts and outputs the value of the first argument after format. The second format specification causes printf to convert and output the second argument, and so on. If there are more arguments than format specifications, printf ignores the extra arguments. The results are undefined if there are fewer arguments than format specifications.

wprintf is a wide-character version of printf; format is a wide-character string. wprintf and printf behave identically if the stream is opened in ANSI mode. printf does not currently support output into a UNICODE stream.

printf_s and wprintf_s perform parameter validation. If format is NULL then the function returns -1 and errno is set to EINVAL.

Return Values

The number of characters output.
Success.
A negative value.
Failure.

Generic Text Routines

tchar.h routine _UNICODE not defined _UNICODE defined
_tprintf printf wprintf
_tprintf_s printf_s wprintf_s

Requirements

Versions Defined in Include Link to
INtime 3.0
INtime 6.0 (for wide-character and generic-text versions)
intime/rt/include/stdio.h
intime/rt/include/wchar.h
intime/rt/include/tchar.h
stdio.h
wchar.h
tchar.h
clib.lib
   
See Also