11 6 [错误]'i'的名称查找已更改为ISO'for'scoping [-fpermissive] [英] 11 6 [Error] name lookup of 'i' changed for ISO 'for' scoping [-fpermissive]

查看:1002
本文介绍了11 6 [错误]'i'的名称查找已更改为ISO'for'scoping [-fpermissive]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#include<iostream>
#include<conio.h>

int a[9][9], b[9][9];

int inputvalue(int x, int y, int value)
{
    for (int i = 0; i < 9; i++) {
        if (value == b[x][i] || value == b[i][y])
            return 0;
    }
    for (i = (x / 3) * 3; i <= ((x / 3) * 3) + 2; i++)
        for (int j = (y / 3) * 3; j <= ((y / 3) * 3) + 2; j++)
            if (b[i][j] == value)
                return 0;
    return value;
}


推荐答案

i 将不会存活第一个for循环。

i won't survive the first for loop. You should declare it before You do anything or declare it again in the second loop.

要理解它,使用google与c,variable,scope关键字

To understand it, use google with "c", "variable", "scope" keywords

这篇关于11 6 [错误]'i'的名称查找已更改为ISO'for'scoping [-fpermissive]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆