求解关于下标要求数组或指针类型的小Q
程序代码:
void judge2(int i,int j, int *win, char c1,char c2,char a) { for (j = 0; j < 6; j++) { for (i = 0; i < 7; i++) { if (((a[i][j] == c1) && (a[i][j + 1] == c1) && (a[i][j + 2] == c1) && (a[i][j + 3] == c1)) || ((a[i][j] == c1) && (a[i + 1][j + 1] == c1) && (a[i + 2][j + 2] == c1) && (a[i + 3][j + 3] == c1)) || ((a[i + 1][j] == c1) && (a[i + 2][j] == c1) && (a[i + 3][j] ==c1) && (a[i][j] == c1)) || ((a[i][j] ==c1) && (a[i + 1][j - 1] == c1) && (a[i + 2][j - 2] == c1) && (a[i + 3][j - 3] == c1))) *win = 1; if (((a[i][j] == c2) && (a[i][j + 1] == c2) && (a[i][j + 2] == c2) && (a[i][j + 3] == c2)) || ((a[i][j] == c2) && (a[i + 1][j + 1] == c2) && (a[i + 2][j + 2] == c2) && (a[i + 3][j + 3] == c2)) || ((a[i + 1][j] == c2) && (a[i + 2][j] == c2) && (a[i + 3][j] == c2) && (a[i][j] == c2)) || ((a[i][j] == c2) && (a[i + 1][j - 1] == c2) && (a[i + 2][j - 2] == c2) && (a[i + 3][j - 3] == c2))) *win = 2; } } }
main中的引用为:
judge2(p1, p2, &win, c[2], c[3], a[7][6]);
求解这个error显示为下标要求数组或指针类型,对象为i和j(红色为首的- -)