C Doubt

Light Poster
12Aug2007,01:42   #1
priyabc's Avatar
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...

Last edited by shabbir; 12Aug2007 at 06:24.. Reason: Code block - http://www.go4expert.com/forums/misc.php?do=bbcode#code
Team Leader
12Aug2007,06:12   #2
DaWei's Avatar
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.