Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   C Doubt (http://www.go4expert.com/forums/c-doubt-t5811/)

priyabc 12Aug2007 01:42

C Doubt
 
Code:

main()
{
    printf("%x",-1<<4)
}

the result for this code is

fff0

how does this result is obtained.. what is the actual process behind it...

DaWei 12Aug2007 06:12

Re: C Doubt
 
ffff is shifted left 4 bits, therefore the left-hand f disappears and a 4 bits of zero appear on the right. I mean it now, you are being silly and acting like a spoiled brat that expects everything to be provided without any effort on your part. Read some documentation.


All times are GMT +5.5. The time now is 22:44.