Question: I'm making a Lotto game for school, I'm stuck at checking the matching numbers.

I've tried a nested for loop and although I can console.log out the matches, it gets overwritten in the next iteration of the loop and I don't understand how I can solve this.

These are my picked numbers, stored here.

```
myNumbers=[1,2,3,4,5,6,7]

```

These are the randomly drawn numbers

```
luckyNumbers=[35,3,17,26,21,9]

```

In this case there's a match for number 3. How do I check this so I can spit out my 2 different graphics, one for No match and one for Match?

```
for ( var i = 0; i < myNumbers.length; i++) {
    for ( var e = 0; e < luckyNumbers.length; e++) {

        if (myNumbers[i] == luckyNumbers[e]){
            matchingPairs.push(myNumbers[i]);
    document.getElementById("ball"+myCounter).src="img/ballCorrect"+myNumbers[i]+".svg";

        }
        else{
        document.getElementById("ball"+myCounter).src="img/ballIncorrect"+luckyNumbers[myCounter-1]+".svg";

        }
          document.getElementById("ball"+myCounter).style.display="inline";
    }
 }

```

Answer: 
If you want to make `my_array` visible only in mylib.c, then you need to define it as `static` in that file and not put anything in the header file.

So mylib.c should contain:

```
static char my_array[MY_ARRAY_SIZE];

```

And mylib.h should not list this variable at all. Not that this means that `MY_ARRAY_SIZE` needs to be visible in mylib.c.
add `extern yourGlobal` in your header, then just declare yourGlobal in one of the file (it's been a while since i last used it, but look for the keyword 'extern' in any case) so you'll be able to use in any file using the header.
 Declare another header whitout to restrict it