The value of n is being passed to my void Cell::setValue(int value) function but m_value does not change. Can anyone explain what is wrong here?
File read in
void SudokuPuzzle::readPuzzle(const char filenameIn[]) {
// Add code to read in a puzzle from the text file and store within the SudokuPuzzle object
ifstream inStream;
inStream.open(filenameIn);
for (int i = 0; i < 9; i++)
{
for (int j = 0; j < 9; j++)
{
int n;
inStream >> n;
m_grid[i][j].setValue(n);
}
}
Set value in cell
void Cell::setValue(int value)
{
m_value = value;
if (m_value = 0)
{
m_given = true;
}
}
For example when n is set to 3 it is passed through to value.
m_value = value does not set m_value to 3.