title: Storing number list individually into 2-D Array in C++
body: <p>Alright so I know how to store numbers into the array but I'm writing a Sudoku program and I need to read and store from an input file. The file will have a half finished Sudoku board and yeah I just have to do some things with it. My issue is that the numbers on the board aren't separated with spaces, like 123456789, and I need to read each number individually to store each one in a different position in the array. However, cin will just get the whole group, whereas cin.get() will give me the ASCII value...so I'm a little confused on how to get them individually stored. Maybe its an obvious answer that I'm just not seeing, I don't know. Any help is appreciated.</p>
  
  <p>Thanks for the reply Nick. I've got a little function to fill the 2-D Array from the input file. Here it is:</p>
  
  <p>for ( i = 0; i &lt; ROWS; i++ )
      {</p>
  
  <pre><code>    for ( j = 0; j &lt; COLS ; j++ )
          {
               in.get(getData);
               data = getData - '0';
              myArray[i][j] = data;
          }
  
  
  }
  </code></pre>
  
  <p>I  added the getData - '0' part that you recommended and it seems to work except that I'm getting this as output.</p>
  
  <p>1|2|3|4|5|6|7|8|9|
  -38|1|2|3|4|5|6|7|8|
  9|-38|1|2|3|4|5|6|7|
  8|9|-38|1|2|3|4|5|6|
  7|8|9|-38|1|2|3|4|5|
  6|7|8|9|-38|1|2|3|4|
  5|6|7|8|9|-38|1|2|3|
  4|5|6|7|8|9|-38|1|2|
  3|4|5|6|7|8|9|-38|1|</p>
  
  <p>The input file right now is just 9X9 rows and columns of '123456789' so it should just output that. Not sure where the -38 is coming from?
  The code that displays it is virtually the same as the one that fills it just different functions right now. Any idea? Meanwhile, I'll be tinkering.</p>
  
  <p>Ok nevermind that, I got that it was reading the endline and throwing things out of wack. I just put a little cin.get(temp) in there to read the endline and continue on. Hope that's the correct way of going about things.</p>