I am new to programming and have an exercise in which I create a function to check whether an array of type char hold particular values.
Here is my function:

```
bool arrCheck(char n[],char pos1,char pos2,char pos3,int size)
{
    int n1,n2,n3;
    for (int i=0;i<size;i++)
    {
        if (n[i]==pos1)
        {
            n1=1;
        }
        if (n[i]==pos2)
        {
            n2=1;
        }
        if (n[i]==pos3)
        {
            n3=1;
        }
    }
    if ((n1==1)&&(n2==1)&&(n3==1))
    {
        return true;
    }
}

```

here is my test program:

```
int main()
{
    char a[5]={'6','1','a','a','a'};
    if (arrCheck(a,'1','6','9',5))
    {
        cout<<"true\n";
    }
}

```

I thought the result is supposed to be false but all I got is true. What did I do wrong?