<p>I want to sprintf() an unsigned long long value in visual C++ 6.0 (plain C).</p>

<pre><code>char buf[1000]; //bad coding 
unsigned __int64 l = 12345678; 
char t1[6] = "test1"; 
char t2[6] = "test2"; 
sprintf(buf, "%lli, %s, %s", l, t1, t2);
</code></pre>

<p>gives the result</p>

<pre><code>12345678, (null), test1
</code></pre>

<p>(watch that <code>test2</code> is not printed)</p>

<p>and <code>l = 123456789012345</code> it gives an exception handle</p>

<p>any suggestions?</p>

Apparently, you did not assign
```
additionaltext
```
to the necessary
```
char *
```
(string). Note that the
```
long int
```
was processed, the comma was copied and only the
```
%s
```
generated
```
(null)
```
.