title: How to ignore end of line while reading file in C?
body: <p>I'm a noob in C-Programming so bear me and please correct me if I've the wrong approach.</p>
  
  <p>I'm facing problem while reading file character by character in C.</p>
  
  <p>As you can see below, 
  apparently, my file has 400 characters but when I try to read them character by character they take up to 419 indexes. I guess they're including end-of-line character too. I don't know how to ignore them. I tried using <code>continue</code> as you can see but I'm unable to ignore them. </p>
  
  <p>Here is my file data</p>
  
  <pre><code>00000000000000000000
  00000000000000000000
  00000000000000000000
  00555555555555555500
  00000000000000000300
  00000000000000000300
  00000000000000000300
  00000000000000000300
  00000000000000000300
  00000000000000000300
  00444444444444444300
  00400000000000000000
  00400000000000000000
  00400000000000000000
  00400000000000000000
  00400000000000000000
  00777777777777777700
  00000000000000000000
  00000000000000000000
  00000000000000000000
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>FILE *pToFile = fopen("toConvert.txt", "r"); 
  
  char single;
  i = end_color; 
  while ((single = fgetc(pToFile)) != EOF) {
  
      if (single != '\0') {   
          continue;
      } else {
          if (single !='0') {
              bitmap[i] = 0x66;  
          } else {
              bitmap[i] = 0xff;
          }
          i++;
      }
  }
  </code></pre>
  
  <p><strong>Note:</strong> I'm trying to add "gray (0x66)" Color in bitmap when a character is 0 and "white 0xff" when a character is anything other than zero. In other words, I've to differentiate between 0 and any other character and it's hard and disturbing with end of line character. </p>