title: fPrintf an integer
body: <p>I am new to C and I am surprised that there is not straight forward function to achieve what I want.</p>
  
  <p>I am executing a program and need to write an integer value to a file. I have code snippet which helps me write into the file:</p>
  
  <pre><code>FILE *in_file  = fopen("test.txt", "w"); 
      fprintf(in_file,"Test");
      // all done!
      fclose(in_file);
  </code></pre>
  
  <p>This code is successfully able to write a string into a file. Now, when I try to write an integer value into that file it does not like it because I guess Fprintf likes to write only string into the files:</p>
  
  <p>so the following code does not work:</p>
  
  <pre><code>int argc = 10;
  FILE *in_file  = fopen("test.txt", "w"); 
      fprintf(in_file,"entry value: %d",argc);
      // all done!
      fclose(in_file);
  </code></pre>
  
  <p>it throws following error:</p>
  
  <blockquote>
    <p>error: too few arguments to function ‘int printf(const char*, ...)’<br>
    printf( );</p>
  </blockquote>
  
  <p>Now,  I tried to find how to print an integer to the file in C but did not find any straightfoward answers. So I am left with two options, either I try to find  a way to convert this integer to a string or have Fprintf write integer value to the file.</p>
  
  <p>I am not sure which one is best option. Any suggestions?</p>