小编r.P*_*ot1的帖子

我的设置函数中的值没有改变

的值n被传递给我的void Cell::setValue(int value)函数但m_value不会改变。任何人都可以解释这里有什么问题吗?

文件读入

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);
    }
}
Run Code Online (Sandbox Code Playgroud)

在单元格中设置值

void Cell::setValue(int value)
{
    m_value = value;

    if (m_value = 0)
    {
        m_given = true; …
Run Code Online (Sandbox Code Playgroud)

c++ arrays getter-setter

2
推荐指数
1
解决办法
55
查看次数

标签 统计

arrays ×1

c++ ×1

getter-setter ×1