Page 1 of 1
long long with printf
Posted: Sun Feb 01, 2004 12:34 am
by PMNOX
I tried to use: printf("%lld,r); and printf("%I64d,r); to print long longer but it doesn't work on acm
int main()
{
long long r = 12345678901234LL;
printf("%lld,r);
}
Posted: Sun Feb 01, 2004 3:40 pm
by Per
Well, you do need to terminate the quote...
The %lld flag for scanf doesn't work at all (it just produces garbage) in the version of gcc+cygwin I have, but otherwise I've never had any problems with %lld.
Posted: Mon Feb 16, 2004 2:40 pm
by anupam
I never faced any problem too.
Posted: Mon Feb 16, 2004 6:24 pm
by UFP2161
For Cygwin, I had to use %L for scanf and %lld for printf. Strange, huh? But when I submit, I always have to change the %L back to %lld.
Posted: Mon Feb 16, 2004 9:29 pm
by Krzysztof Duleba
So your Cygwin installation is somehow broken. On my box %lld works fine with both printf and scanf, on g++ 2.95 and 3.31.
Posted: Tue Feb 17, 2004 8:49 am
by Subeen
I also use %lld, but %lli should also work for long long integer, and %llu is for unsigned long long integer.