I have to code a program that will read in a 2D array of 9 x 9 integers from a file that represents a Sudoku board solution
My goals are to 1. Read in the file and display it on the form (it is a text file) 2. After this, I have to write a validator for the solution
Right now, I’m focusing on part 1 which is reading in the file
Usually, the goal when reading in a file is to do the following (Writing code to select the file) 1. OpenFileDialog oFD = new OpenFileDialog(); 2. if (oFD.ShowDialog() == DialogResult.OK) (File selected so open to read it) 3. StreamReader oSR = new StreamReader(oFD.OpenFile()); 4. int Records = int.Parse(oSR.ReadLine()); (Initializing the arrays) 5. Set array = new int [Records]; 6. for (int i = 0; i < array.length; i++) Array[i] = int.Parse(oSR.ReadLine()); This is the procedure I usually go through to read in a file
My issue is since this is a 2D array, I get the error cannot implicitly