[chbot] Pop quiz C

Mark Atherton markaren1 at xtra.co.nz
Tue Apr 25 23:52:06 BST 2017


Doesn't it depend on what 'a' is declared as, and the language ?

Assuming C, and if 'a' was a U32, and 0xFFFFFFFF was 0xFFFFFFFFL, and 34 was 34L, then possibly the answer might, perhaps, possibly be 0.

having said that, given the context of the question and the person asking the question, I smell an odorous rodent :)

-Mark

http://www.c4learn.com/c-programming/c-bitwise-left-shift-operator/ ties up with my understanding, but again I may need more anti-paranoia medication...


> On 26 April 2017 at 10:04 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?
> 
>      
> 
>      
> 
>      
> 
 

> _______________________________________________
>     Chchrobotics mailing list Chchrobotics at lists.linuxnut.co.nz
>     http://lists.ourshack.com/mailman/listinfo/chchrobotics
>     Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
>     Meetings usually 3rd Monday each month. See http://kiwibots.org for venue, directions and dates.
>     When replying, please edit your Subject line to reflect new subjects.
> 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20170426/edd4170f/attachment.html>


More information about the Chchrobotics mailing list