1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

64 bit data input in c

Discussion in 'C' started by kumardashish, Oct 26, 2010.

  1. kumardashish

    kumardashish New Member

    Joined:
    Nov 8, 2008
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    employee
    Location:
    Bangalore
    hi can any one tell me how to take 64 bit input from console through c language.
    thakx
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    %I64d on Windows.
     
  3. kumardashish

    kumardashish New Member

    Joined:
    Nov 8, 2008
    Messages:
    17
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    employee
    Location:
    Bangalore
    thanx 4 your reply xpi0t0s
    actually i have to write a program to calculate the number of 1 present in it's bit field.
    input number must be 64bit number.
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    OK. I use DWORD64 types in conjunction with %I64d. This is helpful for your project as it's an unsigned type, so you can divide it by 2 without worrying about sign extension.
     
    shabbir likes this.

Share This Page