1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

C Doubt

Discussion in 'C' started by priyabc, Aug 11, 2007.

  1. priyabc

    priyabc New Member

    Joined:
    Feb 9, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    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 a moderator: Aug 12, 2007
  2. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    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.
     

Share This Page