since sizeof returns the size in byte, your for loop only works if the array's datatype is char.
if that's not the case you need to divide it by the size of a single element.
like this:
int sizeA1=sizeof(array1[3])/sizeof(array1[0]);
int sizeA2=sizeof(array2[3])/sizeof(array2[0]);
int sizeA3=sizeof(array3[3])/sizeof(array3[0]);
for (int i=0; i < sizeA1; i++)
{
for (int j = 0; j < sizeA2; j++)
{
for (int k = 0; k <sizeA3; k++)
{
if(array1[i]==array2[j]==array3[k])
newarray[m]=array1[i];
Memo3->Lines->Add(IntToStr(newarray[m]));
}
}
}
Displays 0 in the memo, so it's correct since there are no common elements in the 3 arrays (i have the arrays displayed in other memos, so i know this).
BUT there is 1 common element in array1 and array3 ,and when i write this
1 2 3 4 5 6 7 8 9 10
for (int i=0; i < sizeA1; i++)
{
for (int j = 0; j < sizeA3; j++)
{
if(array1[i]==array3[j])
newarray2[m]=array1[i];
Memo4->Lines->Add(IntToStr(newarray2[m]));
}
}
Displays 0, so there is something wrong. Any ideas??