Chapter 9. Input/output <stdio.h>

Table of Contents
9.1. Formatted Input/Output Functions
9.2. Character Input/Output Functions

Support for <stdio.h> is limited to those function that are useful in the embedded environment. In particular, the only files available are the three standard files, stdin, stdout and stderr. Other files are not available, and functions that operate on such files are omitted.

9.1. Formatted Input/Output Functions

9.1.1. The printf function

Synopsis
#include <stdio.h>

int printf(const char * format , ... );

Description

The printf function is supported as specified in ANSI C 7.9.6.3.

Returns

The printf function returns the number characters printed.

Implementation Notes
  • The printf function uses an internal buffer of 256 characters. This limits the length of the text printed by one call to printf to 255 characters.

9.1.2. The sprintf function

Synopsis
#include <stdio.h>

int sprintf (char * s , const char * format , ... );

Description

The sprintf function is supported as specified in ANSI C 7.9.6.5.

Returns

The sprintf function returns the number of characters printed.

9.1.3. The vprintf function

Synopsis
#include <stdio.h>

int vprintf ( const , char * format , va_list , arg );

Description

The vprintf function is supported as specified in ANSI C 7.9.6.8.

Returns

The vprintf function returns the number of characters printed.

Implementation Notes
  • The vprintf function uses an internal buffer of 256 characters. This limits the length of the text printed by one call to vprintf to 255 characters.

9.1.4. The vsprintf function

Synopsis
#include <stdio.h>

int vsprintf (char * s , const , char * format , va_list arg );

Description

The vsprintf function is supported as specified in ANSI C 7.9.6.9.

Returns

The vsprintf function returns the number of characters printed.