Datasheet

SPRINT LIBRARY
The mikroC PRO for AVR provides the standard ANSI C Sprintf function for easy data formatting.
Note: In addition to ANSI C standard, the Sprint Library also includes two limited versions of the
sprintf function (sprinti and sprintl). These functions take less ROM and RAM and may be more
convenient for use in some cases.
Functions
- sprintf
- sprintl
- sprinti
sprintf
568
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6
Prototype
sprintf(char *wh, const char *f,...);
Returns The function returns the number of characters actually written to destination string.
Description
sprintf is used to format data and print them into destination string.
Parameters :
-
wh: destination string
-
f: format string
The
f argument is a format string and may be composed of characters, escape
sequences, and format specifications. Ordinary characters and escape
sequences are copied to the destination string in the order in which they are
interpreted. Format specifications always begin with a percent sign (%) and
require additional arguments to be included in the function call.
The format string is read from left to right. The first format specification encoun-
tered refers to the first argument after f and then converts and outputs it using
the format specification. The second format specification accesses the second
argument after
f, and so on. If there are more arguments than format specifica-
tions, then these extra arguments are ignored. Results are unpredictable if there
are not enough arguments for the format specifications. The format specifica-
tions have the following format:
% [flags] [width] [.precision] [{ l | L }] conversion_type