title: Building formatted strings in C
body: <p>Lets say I have lots of <code>printf</code> usage, but I want to store them in a string and print them all in one go. Imagine the case below:</p>
  
  <pre><code>printf("%d,", _counter);
  printf("IS REAL,", _condition);
  printf("%f,", _value);
  printf("%d,\r\n", _time);
  </code></pre>
  
  <p>What I want to do is to build a string and use <code>printf</code> only once when I am sure that I want to print it on screen. For example the output of above code will be:</p>
  
  <pre><code>1,IS REAL,663,1044
  </code></pre>
  
  <p>In C# I would use <code>StringBuilder</code>....but how to do this in C?</p>