bool comapare(int val)
{
if(val>5)
{
return true;
}
return false;
}
int myFunct(int x,int y)
{
int count = 0;
count = (int)compare(x) + (int)compare(y);
return count;
}
I want to add bool values as above. Is typecasting it as such the best approach to do so. Any comments.
I see why you are doing it but its confusing to read. BTW the cast is not needed
works fine, but I would do
The intent is much clearer.