How can i compare two arrays?
<p>so my problem is that i need to compare two arrays. Compare them like this,  if the array 1 have values - 1 2 3 and the array 2 have values 3 2 1 the programm finds it as equal.  Right now i only make it work on this if array 1 values  - 1 2 3 and array 2 values - 1 2 3 , then it finds arrays equal, but i need to search arrays who have similar values but not excatly in the same place. 
Right now i use this code below to search for equal values in arrays.  But it wont work if you need to search equal values but in different positions. Hope most of you will understand my problem. And sorry for bad English, its not my native language.</p>

<pre><code> int skaitluParbaude(int loterija[], int speletajs[])
 {
int match = 0;

for (int x = 0; x &lt; SKAITS; ++x)
{
    if (loterija[x] == speletajs[x])
        match = match + 1;

}
return match;
}
</code></pre>