this is part of the program. i keep getting the same index position for numbers that occur more than once. i was wondering if the answer to my problem can be found in this part?
1 2 3 4 5 6 7 8 9 10
int function2(int arr[],int SIZE, int pos)
{
for (int a=0;a<SIZE;a++)
{
if(arr[a]==pos)
{
return a;
}
}
}
it takes the values from one array and searches for their index position in another array(linear search algorithm). i got that down except for the part i mentioned above