Navigation

Operators and Keywords

Function List:

C++ API

: sprintf (template, …)

This is like printf, except that the output is returned as a string.

Unlike the C library function, which requires you to provide a suitably sized string as an argument, Octave’s sprintf function returns the string, automatically sized to hold all of the items converted.

Implementation Note: For compatibility with MATLAB, escape sequences in the template string (e.g., "\n" => newline) are expanded even when the template string is defined with single quotes.

See also: printf, fprintf, sscanf.

Package: octave