LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

printf

printf

int printf (const char formatString[], ...);

Purpose

Writes output to standard output according to format specifiers in formatString.

By default, the Windows console window moves to the foreground each time data is written to it. You can disable this behavior with the SetStdioWindowOptions function.

Parameters

Input
Name Type Description
formatString const char [] Contains the format string that specifies how subsequent arguments are converted for output. Use standard ANSI C format specifiers. If insufficient arguments exist for the format, the behavior is undefined. If the format is exhausted while arguments remain, the excess arguments are evaluated but are otherwise ignored.
Note Note  For more information about the standard ANSI C format specifiers, refer to an external ANSI C reference.
source_s ... Specifies one or more arguments that are to be converted and written to the standard output. If there are multiple arguments, they must be separated by commas.

Return Value

Name Type Description
CharactersWritten int Contains the number of characters transmitted or a negative value if an output error occurred. If an error occurs, printf sets errno to a nonzero value.

Additional Information

Library: ANSI C Library

Include file: ansi_c.h

LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later

Example

Refer to userint\standardio.cws for an example of using the printf function.

Was this information helpful?

Previous

vsscanf

Previous

vsscanf