i need to compare the values of two separate 2d arrays and return true if the corresponding elements in both arrays are equal and false if they are not. this is what i have so far:
//i can print the two arrays but how do i compare their corresponding elements?
#include<iostream>
using namespace std;
int main() {
int array2d[3][2] = {{1,2}, {3,4}, {5,6}};
int isEqual2d[3][2] = {{1,2}, {3,4}, {6,7}};
int i;
int j;
int k;
void print2d(int array2d[][2], int numRows);
print2d(array2d,3);
void print2dd(int isEqual2d[][2], int numRows);
print2d(isEqual2d,3);
}
void print2d(int array2d[][2], int numRows){
for(int i = 0; i < numRows; i++){
for(int j = 0; j < 2;j++){
for(int k = 0; j < 2;j++)
cout << array2d[i][j] << " ";
cout << endl;
}
}
}
void print2dd(int isEqual2d[][2], int numRows){
for(int i = 0; i < numRows; i++){
for(int j = 0; j < 2;j++){
for(int k = 0; j < 2;j++)
cout << isEqual2d[i][j] << " ";
cout << endl;