I am creating the function, compare_arrays to check if elements inside the pre-defined arrays are similar. I want to use pointer and pass the arrays by reference into the function. This is the function I coded so far but pylint is giving me an error for my second if loop stating that *arry1 and *arry2 are not defined. Can someone help me understand this error better.
Also, how do I call the function and pass in arr_one, arr_two, etc.....
#include <iostream>
using namespace std;
int size1 = 3, size2 = 3;
int arr_one[] = {1, 2, 3};
int arr_two[] = {1, 2, 3};
int main(){
bool compare_arrays( int *arry1, int size1, int *arry2, int size2);{
if (size1 != size2){
return false;
}
for(int i=0; i < size1; i++);{
if (*arry1 != *arry2);{
return false;
}
}
*arry1++;
*arry2++;
return true;
}
}