EAGLE Help

sprintf()


Function
Writes formatted output into a string.

Syntax
int sprintf(string result, string format[, argument, ...]);

Returns
The sprintf function returns the number of characters written into the result string.

In case of an error, sprintf returns -1.

See also printf

Format string

See printf.

Binary zero characters

Note that sprintf can not return strings with embedded binary zero characters (0x00). If the resulting string contains a binary zero character, any characters following that zero character will be dropped. Use printf if you need to output binary data.

Example

string result;
int number = 42;
sprintf(result, "The number is %d", number);

Index Copyright © 2005 CadSoft Computer GmbH