title: How to get the character at the current position using C program?
body: <p>I am trying to write a C program to get the character in the file which is ofset by some bytes, lets say three as below</p>
  
  <pre><code>fseek(fp,3,SEEK_CUR);
  </code></pre>
  
  <p>I wish to print the character which that particular byte represents. For example if my file contains something like below,I need to print every third character. </p>
  
  <pre><code>//reading from file//
  </code></pre>
  
  <p>The problem is that after using a <code>while</code> loop I am not able to print the desired result. The first character which gets printed is the fourth character instead of third. </p>
  
  <pre><code>while(fp!=EOF)
  {
      fseek(fp,3,SEEK_CUR);
      ch = fgetc (fp);
      printf("%c",ch);
  }
  </code></pre>
  
  <p>Can you please help me in understanding what is the mistake with this. Thanks!</p>