title: What is the use of `putw` and `getw` function in c?
body: <p>I wanna know the use of <code>putw()</code> and <code>getw()</code> function. As I know, these are used to write and read from file as like as <code>putc</code> and <code>getc</code> but these deals with only integers. But when I use these for writing integers, it just write different symbol in file (like if I write <code>65</code> to file using <code>putw()</code>. It writes <code>A</code> in the file). Why does it take the ASCII value? I am using codeblocks 13.12. Code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main() {
      FILE *fp;
      int num;
  
      fp = fopen("file.txt", "w");
      printf("Enter any number:\n");
      scanf("%d", &amp;num);
      putw(num, fp);
      fclose(fp);
      printf("%d\n", num);
  
      return 0;
  }
  </code></pre>