Compare Two Arrays of Different Lengths and Return the Common Values

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.

byte array[ 20 ];
byte *a = array; // now *a points to the beginning of array[ 20 ]

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.