Hi, I've been trying for hours to find out the error in this program, it has something to do with passing the array to the function, here is the program:
#include <iostream>
usingnamespace std;
bool identical(int, int, int);
void main()
{
int a[99999], b[99999], n;
bool check;
cout<<"Please enter the number of integers per set: ";
cin>>n;
cout<<"Please enter the integers of the fist set:\n";
for (int i=0; i<n; i++)
cin>>a[i];
cout<<"Please enter the integers of the second set:\n";
for (int j=0; j<n; j++)
cin>>b[j];
check = identical(a[], b[], n);
if (check == true)
cout<<"The two sets are identical";
else
cout<<"The two sets are identical";
}
bool identical(int a[], int b[], int n)
{
bool end = false;
for (int i=0; i<n; i++)
if (a[i]!=b[i])
{
returnfalse;
end = true;
}
if (end == false)
returntrue;
}
And the error is:
........program 3.cpp(20) : error C2059: syntax error : ']'
Also, this is my second C++ code so I'm kind of a no0b :P So please don't overload me with too much tech talk xP