Write a function template contains that accepts an array of the parameterized type, the number of elements in the array (an integer), and a value of the parameterized type, and returns true if the value is in the array and false otherwise.

template<class T>
bool contains(T a[], int k, T p)
{
bool stat = false;
for(int i=0; i < k; i++)
{
if(a[i] == p)
{
stat = true;
}
}
return stat;
}

saying compiler error...help please