title: How to concatenate string and int in C?
body: <p>I need to form a string, inside each iteration of the loop, which contains the loop index <code>i</code>:</p>
  
  <pre><code>for(i=0;i&lt;100;i++) {
    // Shown in java-like code which I need working in c!
  
    String prefix = "pre_";
    String suffix = "_suff";
  
    // This is the string I need formed:
    //  e.g. "pre_3_suff"
    String result = prefix + i + suffix;
  }
  </code></pre>
  
  <p>I tried using various combinations of <code>strcat</code> and <code>itoa</code> with no luck. </p>