title: How to compare int with char?
body: <p>Ok basically, I have a file containing a 9x9 grid (sudoku puzzle). Now this sudoku puzzle is only partially completed, the empty spaces are replaced with "_" (underscores). So here is how the file looks.</p>
  
  <pre><code>5 _ _ _ _ _ 1 7 _ 
  1 _ 6 5 _ 9 _ 4 _ 
  4 7 2 1 _ 6 _ _ _ 
  9 _ _ _ _ _ 5 _ _ 
  _ 1 8 _ 9 5 4 _ _ 
  6 _ _ 4 _ 2 3 8 9 
  _ 4 _ _ _ _ 9 3 _ 
  _ 9 _ 7 _ 3 _ 5 _ 
  2 6 3 9 5 8 7 1 4 
  </code></pre>
  
  <p>And here is my code:</p>
  
  <pre><code>for(int row=0;row&lt;9;row++)
  {
      for(int column=0;column&lt;9;column++)
      {
          fin &gt;&gt; num;
          if(num == '\95')
              sudokuPuzzle[row][column] = 0;
          else
              sudokuPuzzle[row][column] = num;
          cout &lt;&lt; sudokuPuzzle[row][column] &lt;&lt; " ";
      }
      cout &lt;&lt; endl;
  }
  </code></pre>
  
  <p>The problem I'm having is on this line:</p>
  
  <pre><code>if(num == '\95')
  </code></pre>
  
  <p>I looked in an ASCII table for the decimal value of underscore and that was what I found. However, whenever the cout statement in my loop executes, it shows that my array is filled with just the first number in the file, 5. How do I make a proper comparison between integers and characters?</p>
  
  <p>FYI: essentially what I am attempting to do is replace all underscores with 0.</p>