"Joerg Schwerdtfeger" <sc*******@gmx.de> wrote in message news:c4*************@news.t-online.com...
Hi everyone,
I want to input & output an unsigned long long int variable, but
printf/sscanf seems to interpret the least significant 32 bits only.
Does your compiler support ULLs?
I assume this is a bloody newbie-question, but reading the clc-faq and
googleing for this issue, I only found out that this might be a known
problem - but how can I fix it? Are there any workarounds, e.g. other
io-routines who can handle ull-ints?
Thanks in advance,
Joerg
F:\Vijay\C> type ull.c
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int
main ( void )
{
unsigned long long int ull;
printf ( "ULLONG_MAX: %llu\n", ULLONG_MAX );
printf ( "Enter an ull value: " );
scanf ( "%llu", &ull );
printf ( "\nThe ull value is: " );
printf ( "%llu", ull );
return EXIT_SUCCESS;
}
F:\Vijay\C> gcc -std=c99 -Wall
F:\Vijay\C> a.exe
ULLONG_MAX: 18446744073709551615
Enter an ull value: 18446744073709551614
The ull value is: 18446744073709551614