Reputation: 638
I do not understand the following c++ statement:
int c;
switch (c) {
case 'a': ... ;
case 'c' | 0x100: ... ;
case 'c': ...;
}
What is the difference between case 'c' and case 'c' | 0x100? Isn't it the same and case 'c' is never reached?
Upvotes: 1
Views: 995
Reputation: 539
No, those are two different numbers.
'c' equals to 0x063
'c'|0x100 equals to 0x163
Upvotes: 2