Int vs Char problem

I'm making a Sudoku game. When reading in from a file, I would like to convert all of my "0" to blank spaces. However, no matter what I do, those "blank spaces" always turn to "32" because, that's the value of a space on the ASCII Table. How do I change this? This is my code:

1
2
3
4
5
6
7
8
9
10
11
 for (int col = 0; col < 9; col++)
   {
      for (int row = 0; row < 9; row++)
      {
         fin >> sudokuBoard[row][col];
         if (sudokuBoard[row][col] == 0)
         {
            sudokuBoard[row][col] = (char)' ';
         }
      }
   }
Last edited on
When you say you want to convert 0s to blank spaces, do you mean for display purposes?

In the array sudokuBoard, there needs to be some placeholder to represent the '0' or the 'blankspace'!
Last edited on
Topic archived. No new replies allowed.