What is the value of ~\'q\' << 6 on a machine with 32-bit ints and 8 bit chars, that uses Latin-1 character set in which \'q\' has the bit pattern 01110001
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:4| Question number:25
All Answers
total answers (1)
1. The operand of `~` operator is a "small integer"(`char` here), thus its value is first promoted to a larger integral type(`int` here).
2. After the `~` operator evaluated,
3. Left shift,
4. The result is -7296.
need an explanation for this answer? contact us directly to get an explanation for this answer