i am fixing something and i have that fuction in it
bool DeckOfCards::checkFlush(const Card checkCards)
{
counter=0;
cardCheck=" ";
for(int x=1;x<5;x++)
{
cardCheck=checkCards.suits[x];
for(int y=0;y<5;y++)
{
found=hand[y].find(cardCheck);
if(found!=string::npos)
{
counter++;
}
}
if(counter==5)
{
return true;
}
counter=0;
}
}
it goes here:
bool result=false;
if((result=checkFlush(checkCards))==true)
{
return winner=5;
}
it returns true all the time even if the counter never gets 5
why???????? :D