stringprintf

March 26, 2020 Contributors

Name

stringprintf — Print a formatted string

Synopsis

#include "misc/ec_string.h"

| string * **stringprintf** ( | str, |   |
|   | format, |   |
|   | ); |   |

string * <var class="pdparam">str</var>;
const char * <var class="pdparam">format</var>;
<var class="pdparam">...</var>;

Description

Format a string passing in the format argument(s). Use this function in the following way:

stringprintf(out, "header '%s' has %d nodes %d childnodes\n",
    parent->ancestry, parent->nodes->size, parent->childnodes->size);

Parameters

str

The ec_string.

format

The string with embedded format specifier(s).

The variable argument(s).

Return Values

Returns the formatted string.

Threading

It is legal to call this function in any thread.

See Also

“string”