title: Creating C formatted strings (not printing them)
body: <p>I have a function that accepts a string, that is:</p>
  
  <pre><code>void log_out(char *);
  </code></pre>
  
  <p>In calling it, I need to create a formatted string on the fly like:</p>
  
  <pre><code>int i = 1;
  log_out("some text %d", i);
  </code></pre>
  
  <p>How do I do this in ANSI C?</p>
  
  <hr>
  
  <p>Only, since <code>sprintf()</code> returns a int, this means that I have to write at least 3 commands, like:</p>
  
  <pre><code>char *s;
  sprintf(s, "%d\t%d", ix, iy);
  log_out(s);
  </code></pre>
  
  <p>Any way to shorten this?</p>