Can You Help ME??

how can I write the algorithm within using array
example:
a = 1 2
3 4

b = 8 2
3 5


result c = 0 1 //when element a=b result=1, else = 0
1 0

1
2
3
4
5
6
7
8
9
void Check(int** a, int** b, int** c, int width, int height)
{
    for (int h=0;h<height;h++)
        for (int w=0;w<width;w++)
            if (a[h*height+w]==b[h*height+w])
                c[h*height+w]=1;
            else
                c[h*height+w]=0;
}


Can this function do your task ?
Last edited on
Topic archived. No new replies allowed.