So I've come up with something like this
int common_elements(int a[], int b[]){
a.sort();
b.sort();
n, o = 0, 0;
common = [];
while n < len(a) and 0 < len(b):
if a[n] == b[o]
{
common.append(a[i]);
n += 1;
o += 1;
}
if (a[n] < b[o])
{
n += 1;
else
{
o += 1;
}
}
I think I've got something wrong with the types as it fails to compile with this error. Anyone wanna point out any errors, I'm not that experienced with C code. Thanks
reguest for member 'sort' in 'a'. which is of non-class type 'int*'
A little more data on the input. One string contains 7 fixed numbers and the other contains three fixed numbers. I want to find the common numbers in the two arrays in order to iterate though a couple sets of color and pinout data