# Printf utils

The mwx library uses an implementation of printf, which is commonly used in C, for formatting output. Function definitions for several functions are available.

```cpp
int mwx_printf(const char* format, ...)
int mwx_snprintf(char* buffer, size_t count, const char* format, ...)
```

`mwx_printf()` prints a printf output to the Serial object. It is the same process as `Serial.printfmt()`.

mwx\_snprintf()\` prints a snprintf to a buffer.

{% hint style="info" %}
Array class \[smplbuf]\(... /... /classes/smplbuf/), you can use [mwx::stream to generate data](/latest_en/api-reference/classes/smplbuf.md#mwxstreamdedta).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mwx.twelite.info/latest_en/api-reference/funcs/utility/printf-utils.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
