[chbot] Pop quiz C

Paul Davey plmdvy at gmail.com
Wed Apr 26 00:58:41 BST 2017


On Wed, Apr 26, 2017 at 10:04 AM, hamster <hamster at snap.net.nz> wrote:
> Sorry - no chocolate fish this time
>
> What is the value of a?
>
>   a = 0xFFFFFFFF << 34;
>
> Have you checked your answer?
>
If a is 32 bits wide then any value at all and even different values
if you look at it more than once, because shifting by larger than the
width of the type is undefined behaviour.



More information about the Chchrobotics mailing list