title: How to compare an integer with newline in C?
body: <p>I already know how to compare char type with newline (\n) but I would like to know how to compare an Integer with the newline (\n). Is it possible? 
  (I did researches to find my answer but I end up getting answer that require char types)</p>
  
  <p>I've the text file input with numbers:</p>
  
  <pre><code>11 22 33 44 55 1
  2 3 4 56 777
  1
  255
  3
  5
  </code></pre>
  
  <p>I want the output to look like this</p>
  
  <pre><code>[11][22][33][44][55][1]&lt;newline&gt;[2][3][4][56][777]&lt;newline&gt;[1]&lt;newline&gt;[255]&lt;newline&gt;[3]&lt;newline&gt;[5]&lt;newline&gt;
  lineNumber:[6]
  </code></pre>
  
  <p>but the output I get is </p>
  
  <pre><code>[11][22][33][44][55][1][2][3][4][56][777][1][255][3][5]
  lineNumber:[0]
  </code></pre>
  
  <p>This is the code I'm using</p>
  
  <pre><code>int *integers = malloc(sizeof(int) * 200);
  int i=0, lineNumber=0, num=0;
  //int num;
  
  while(fscanf(file, "%d", &amp;num) &gt; 0) 
  {       
      if(num == '\n'){
          printf("&lt;newline&gt;");
          lineNumber++;
      }
  
      integers[i] = num;
  
      printf("[%d]", integers[i]); // Just to show output.
      i++;
  }
  printf("\nlineNumber:[%d]", lineNumber);
  </code></pre>
  
  <p>Reason why I don't want to use the char type is because I've to re-convert the char digits into integer... I would like to care about the newline (\n) and integers only</p>