long long int AND __int64

Write here if you have problems with your C source code

Moderator: Board moderators

Post Reply
New poster
Posts: 25
Joined: Sun Sep 05, 2004 12:41 am

long long int AND __int64

Post by muvee »

I am running VC++ 6.0

Is there any way I can get the 'long long int' to work in it? Currently I am using __int64 and that is working fine.

However when I change my __int64 into 'long long int' and make the relative scanf and printf changes as well, I am forced to submit my solution without testing because VC++ on my computer does not support long long int.

Allternatively is there a way to make the Online Judge work with __int64?

So basically there are 2 questions:

1) How to use the 'long long int' in VC++ 6.0 in this form i.e. without resorting to__int64
2) How to make the online judge to accept my code if I have used __int64
in it.


Dominik Michniewski
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland

Post by Dominik Michniewski »

use something like this

#define LONG long long int
#define LONG __int64

and after this use only LONG datatype ;-)

Best regards
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)

New poster
Posts: 25
Joined: Sun Sep 05, 2004 12:41 am

Post by muvee »

But the problem is that for __int64, I would need to use printf("%I64D",num)
where as for long long it would be different. BTW, what is the exact format for printing long long ints using printf?

Krzysztof Duleba
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland

Post by Krzysztof Duleba »

[cpp]printf("%lld", long_long_variable);[/cpp]

Experienced poster
Posts: 105
Joined: Tue Oct 14, 2003 3:24 pm
Location: Utrecht, Holland

Post by Maniac »

muvee, I have exactly the same problem. Let me know when you have a structural solution!

What I currently do is use a define statement for LONG (like Dominik Michniewski does) and then just before I send in to the judge, I change the printf statements by hand and send in the program without recompiling (while hoping I've made no typos) :-)

Post Reply

Return to “C”