Long long in windows whit scanf(and MINGW)(SOLUTIONED)

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
gareve25
New poster
Posts: 5
Joined: Mon Feb 11, 2008 8:38 pm

Long long in windows whit scanf(and MINGW)(SOLUTIONED)

Post by gareve25 » Sun Feb 01, 2009 6:59 pm

This question it's not of live or death, just knowledge
I have a question, i use the mingw in windows, and when i read a number with scanf("%lld %Ld %Lf ") the values of my variables are junk, but, when i send to the judge, the answer is AC. Someone knows why happen this, the are a solution to this (using scanf)
PS: i'm forced to use cin
Last edited by gareve25 on Sun Feb 01, 2009 10:38 pm, edited 1 time in total.
Just beginning to make my brain more strong

mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:

Re: Long long in windows whit scanf(and MINGW)

Post by mf » Sun Feb 01, 2009 7:32 pm

Use %I64d instead of %lld while compiling on mingw. Blame Microsoft for that - the problem is with their implementation of printf and scanf in msvcrt.dll.

gareve25
New poster
Posts: 5
Joined: Mon Feb 11, 2008 8:38 pm

Re: Long long in windows whit scanf(and MINGW)

Post by gareve25 » Sun Feb 01, 2009 10:32 pm

thanks for the data mf, 0.0000001% less ignorant
Just beginning to make my brain more strong

Post Reply

Return to “C++”