-3

I want to check if 2d array is equal to int variable but the problem "ISO C++ forbids comparison between pointer and integer [-fpermissive]" shows up.

#include <bits/stdc++.h>
using namespace std;

const int height = 50;
int stone = 1;
int dot = 2;
int blank = 0;

void draw(int x, int t)
{
    int width = x;
    int board[height][width];

    for(int i=0;i<width;i++)
    {
        board[i][0]=blank;
    }
    
    board[t][0]=dot;

    for(int y=0;y<height;y++)
    {
        for(int j=0;j++;j<width)
        {
            if(board[y][j-1]==dot && board[y][j+1]==blank)
            {
                board[y+1][j-1]=stone;
                board[y+1][j+1]=stone;
            }
            
            else 
            {
                board[y+1][j]==board[y][j];
            }
            cout<<board[y+1][j];
        }
    cout << endl;
    }
}

I dont really know what to do edit: here is full code.

blobaben
  • 1
  • 1

1 Answers1

1

Code as below compiles for me, so error is somewhere else.

int board[3][4];

int dot = 2;
int blank = 0;

int main()
{
    int y = 1;
    int j = 1;
    if(board[y][j-1]==dot && board[y][j+1]==blank)
        ;
}

You need to show more.