title: How to convert integer to string in C?
body: <p>I tried this example:</p>
  
  <pre><code>/* itoa example */
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main ()
  {
      int i;
      char buffer [33];
      printf ("Enter a number: ");
      scanf ("%d",&amp;i);
      itoa (i,buffer,10);
      printf ("decimal: %s\n",buffer);
      itoa (i,buffer,16);
      printf ("hexadecimal: %s\n",buffer);
      itoa (i,buffer,2);
      printf ("binary: %s\n",buffer);
      return 0;
  }
  </code></pre>
  
  <p>but the example there doesn't work (it says the function <code>itoa</code> doesn't exist).</p>