In-class practice known two integer arrays [10], a [10] and b write a using array as parameter of function, the function to find whether there is a same element in the array a and b, the return value is a elements found in the same address, if not found, it returns NULL,
CodePudding user response:
Use the mapInt * FindSame (int * a, int size_a, int * b, int size_b)
{
Map
int i;
For (I=0; I & lt; Size_a; I++)
{
Mark [b] [I]=true;
}
For (I=0; I & lt; Size_a; I++)
{
If (mark. The find (a [I])!=mark. The end ())
Return & amp; A, [I].
}
return NULL;
}