[Dev-C++] Can I handle 64 bits with unsigned long long int ?
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Roberto R. <rob...@ar...> - 2003-04-05 23:10:58
|
Hi all,
Can I handle 64 bits numbers with unsigned long long ?
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
unsigned long long int D0,D1 ;
int main(int argc, char *argv[])
{
D0 = 0;
D1 = 0xffffffffffff; /* I put first unsigned long int, compiler
alerts about truncated number...) */
gotoxy(1,9);printf ("Num hexa : ");
scanf ("%x",&D0); /*can handle whatever up to 32 bits*/
gotoxy(1,11);printf ("Dec0: %lu\nDec1: %lu\n\n", D0, D1);
getchar(); getchar();
return 0;
}
/*
Results:
Dec0 : 4294967295 mean ok if I put just up to 0xffffffff 32bits
Dec1 : 0 ??
*/
Why is ever truncated in 32 bits, how can handle long long to get up to
64 bits numbers ?
Thanks in advance
Roberto
|