How would you do it if it was two lists of letters or numbers on paper?

Let's say letters and these are the lists:

A B C D A B C D

A A C D C B A B C A D D D

Would you start with the first letter of the first list and find a match in the second list?And if you do, will you record that?Will you remove the matched letter in the second list so it doesn't get matched again?And then on to the next letter in the first list? And the next till it's done?

Just how... sorry but I won't write your code. But I will suggest modeling the actions and playing with for-next and while loops and keeping information in variables before deciding what to write.

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

Unless you have a particular need for this to run as fast as possible, for arrays that small I wouldn't bother sorting them and would just brute-force compare the unsorted arrays element by element.

for each element in left array for each element in right array if left == right append to results

If you want the results to be unique and the input arrays are not unique then I'd implement the append operation in a function that checked the new result against the values already in the result array.

I only provide help via the forum - please do not contact me for private consultancy.

This is C++ but you have to use a container class (hope you've got the RAM) to get that sort.But honestly, it's more work to sort the arrays than to simply find matches.

Also OP, learn to use pointers and pass those to your functions. Pointers are like using web links except for RAM. They're just address holders with names that know the size variable they point to. You ++ a pointer, it points to the next variable in your array. The array name is itself a pointer to the start of the array.

There's a very few steps to learn that you can pick up between examples and explanations.

Work the steps out with pencil and paper or keyboard and editor. Understanding what you're doing will in the end show you how simple the basis is and no magic pill class function will ever do that. In fact, magic pill functions is a great way to **never learn** how simple these things work which means for the next and next problem the answer will be finding more magic pills.

C is really very simple at heart. So is any alphabet. What you do with either can make the complexity. You don't need to include all of Crime and Punishment to refer to beating a dead horse.