user7779: I have to admit that I can't really use this function.
I'm trying to format some json but it crashing all the time my arduino:
char response[300];
tmp = "123";
snprintf(response, 300, "[{Name:'Furnace',Value=%s,Alarm={MinValue=%s,MaxValue=%s}},{Name:'Room',Value=%s,Alarm={MinValue=%s,MaxValue=%s}}]", tmp);

How should I use this function properly?

user7508: char response[300];
tmp = "123";
snprintf(response, 300,
    "[{Name:'Furnace',Value=%s,Alarm={MinValue=%s,MaxValue=%s}},"
    "{Name:'Room',Value=%s,Alarm={MinValue=%s,MaxValue=%s}}]",
    tmp, tmp, tmp, tmp, tmp, tmp);

In other words, you should add, after the format string, as many extra
parameters as there are %s in the format string.
PS: This looks like JSON, but it is not really valid JSON.
The format below should give valid JSON:
"[{\"Name\":\"Furnace\",\"Value\":%s,"
"\"Alarm\":{\"MinValue\":%s,\"MaxValue\":%s}},"
"{\"Name\":\"Room\",\"Value\":%s,"
"\"Alarm\":{\"MinValue\":%s,\"MaxValue\":%s}}]",


7779: <p>I have to admit that I can't really use this function.</p>

<p>I'm trying to format some json but it crashing all the time my arduino:</p>

<pre><code>char response[300];
tmp = "123";
snprintf(response, 300, "[{Name:'Furnace',Value=%s,Alarm={MinValue=%s,MaxValue=%s}},{Name:'Room',Value=%s,Alarm={MinValue=%s,MaxValue=%s}}]", tmp);
</code></pre>

<p>How should I use this function properly?</p>
 7508: 

<pre class="lang-c prettyprint-override"><code>char response[300];
tmp = "123";
snprintf(response, 300,
    "[{Name:'Furnace',Value=%s,Alarm={MinValue=%s,MaxValue=%s}},"
    "{Name:'Room',Value=%s,Alarm={MinValue=%s,MaxValue=%s}}]",
    tmp, tmp, tmp, tmp, tmp, tmp);
</code></pre>

<p>In other words, you should add, after the format string, as many extra
parameters as there are %s in the format string.</p>

<p>PS: This looks like JSON, but it is not really valid JSON.
The format below should give valid JSON:</p>

<pre class="lang-c prettyprint-override"><code>"[{\"Name\":\"Furnace\",\"Value\":%s,"
"\"Alarm\":{\"MinValue\":%s,\"MaxValue\":%s}},"
"{\"Name\":\"Room\",\"Value\":%s,"
"\"Alarm\":{\"MinValue\":%s,\"MaxValue\":%s}}]",
</code></pre>
