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.
I've found a workaround:

```c
#ifndef _MYLIB_H_
#define _MYLIB_H_

void test();

#ifndef _MYLIB_C_

char my_array[MY_ARRAY_SIZE];
#define my_array 0

#endif /* _MYLIB_C_ */
#endif /* _MYLIB_H_ */

```

I just redefine name of array by zero after it declaration. So, if somebody try to use that name in `main.c` he is obviously get a compiler error. But in `mylib.c` still everything is OK. It's better than nothing.