title: Convert int to char* C
body: <p>So I am trying to read the words from a file. However, I have to use <code>putchar(ch)</code> where <code>ch</code> is an <code>int</code>. How do I convert ch to a string (char *) so I can store it in a char * variable and pass it to another function that takes char * as a parameter. And I actually just want to store it but not print it.</p>
  
  <p>This is what I have:</p>
  
  <pre><code>int main (void)
  {
     static const char filename[] = "file.txt";
     FILE *file = fopen(filename, "r");
     if ( file != NULL )
     {
        int ch, word = 0;
        while ( (ch = fgetc(file)) != EOF )
        {
           if ( isspace(ch) || ispunct(ch) )
           {
              if ( word )
              {
                 word = 0;
                 putchar('\n');
              }
           }
           else
           {
              word = 1;
              putchar(ch);
           }
        }
        fclose(file);
     }
     return 0;
  }
  </code></pre>