Question: I am learning to use C in my operating systems class and this is what I have so far for my function to find the intersection of two arrays.

An intersection basically is when you take two sets and you get ONLY the elements that are in both sets.

So for example if set A contains = {1,2,3} and set B contains = {2,3,4} then the intersection of A and B are {2,3}. I'm trying to create a function in C that gets two arrays and returns an array containing integers that are in both passing arrays.

I think I almost have the solution here, but I'm getting an error that says:
"identifier 'count' is undefined" 

```
    int intersection(int array1[4], int array2[4])
    {       
        int arrayReturn[sizeof(array1) + sizeof(array2)]
        int count = 0;

        for(int i = 0; i < 4; i++)
        {
            for(int j = 0; j < 4; j++)
            {
                if(array1[i]==array2[j])
                {
                    count = count + 1;
                    arrayReturn[count] = array1[i];
                }
            }
        }

    }

```

I'm very used to Java and I feel like Java and C are nearly identical. I can't really find what's wrong here since count is well within its scope inside the if statement. I don't see how count is undefined.

What's wrong with count and how could I fix this intersection function?

Answer: 
Missing a semi colon on this line:

```
int arrayReturn[sizeof(array1) + sizeof(array2)]; //semicolon was missing

```
```
void readArr(int  arr1[],int n1, int arr2[],int n2,int arr3[]){
int n=0;
int j=0;
for(j=0;j<n1;j++){
    for(int k=0; k<n2;k++){
        if(arr1[j]==arr2[k]){
            int element = arr1[j];
            int k=checkArrayContains(arr3,n,element);
            if(k==1){
                printf("%d\n",arr1[j] );
                arr3[n]=arr1[j];

                n++;

            }

        }

    }
}

displayArray(arr3,n);}

```

I think this implementation is more clear.