[cfe-dev] why is such a code allowed?

Guy Maurel guy.maurel at kde.org
Fri Feb 6 08:19:30 PST 2015


Hello!

Let say: 
    int a = 5;
    int b = 7;
    int i = 20;
    if ((a  == b) + i) {
        a = 15;
    }
My question is:
The expression (a == b) gives a bool result.
Why is it allowed to add a "bool" and an "int".

Thanks
-- 
Guy Maurel



More information about the cfe-dev mailing list