Finding a 'Proper Subset'
Hi, I've been having trouble getting a piece of code I've made to find whether a set is a proper subset of another. The code I'm using is the following:
Code:
bool contain(bool arrayA[letter],bool arrayB[letter])
{
int i,counter,counter2;
counter=0;
counter2=0;
for (i=0;i<letter;i++)
{
if (arrayA[i]==arrayB[i]) counter++;
if (counter==26) return false;
else break;
}
for (i=0;i<letter;i++)
{
if (arrayB[i]==true)
{
counter++;
if (arrayA[i]==true) (counter2++);
}
}
if ((counter==counter2)/*&&(counter!=0)*/) return (true);
else return(false);
}
The problem is, when I run the program, the output always comes out False :( . Any help is appreciated.