64 bit data input in c

kumardashish's Avatar, Join Date: Nov 2008
Go4Expert Member
hi can any one tell me how to take 64 bit input from console through c language.
thakx
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
%I64d on Windows.
kumardashish's Avatar, Join Date: Nov 2008
Go4Expert Member
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.
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
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 like this