title: How to store the resulting formatted C string
body: <p>This is a newbie question. To create a formatted C string, I use <code>printf</code>, like:</p>
  
  <pre><code>int n = 10;
  printf("My number is %i", 10);
  </code></pre>
  
  <p>But, how about:</p>
  
  <pre><code>int n = 10
  char *msg = "My number is %i", 10;
  printf(msg);
  </code></pre>
  
  <p>How can I store the resulting formatted string in a variable? I want "My number is 10".</p>