If statements in VC

Should we consider where we have the following if statement, chars used in check condition since they also are integer types:
int main(){ char a = 'a'; if (a) return 5; else return 3; }

Conditions: The type of a condition (if, while, …) has to be scalar

As you can see in Figure 2, char is scalar.

1 Like

What should happen so that if(a) goes to else case ?
If a were ‘0’; would it be true or wrong?
Should we do something like '0' == 0 ?

'0' (the character constant) has value 48. So it behaves as if a '48' was written there.