Page 1 of 1

long long int ? help

Posted: Sat Mar 01, 2003 10:53 am
by Eric____
from past posts, i saw discussion on using long long int
for example
[cpp]{
unsigned long long ull = 0xffffffffffffffff; // 18446744073709551615
[/cpp]

when i compiled this, i got error saying long followed by long s illegal,
is it problem w/ the compiler? plz help.[/cpp]

How about this?

Posted: Sat Mar 01, 2003 4:35 pm
by suman
How about this?
[cpp] #ifdef _MSC_VER
typedef _int64 Long;
typedef _int32 Int;
typedef unsigned _int64 ULong;
typedef unsigned _int32 UInt;
#elif __GNUC__
typedef long long Long;
typedef long Int;
typedef unsigned long long ULong;
typedef unsigned long UInt;
#elif __BCPLUSPLUS__
typedef __int64 Long;
typedef __int32 Int;
typedef unsigned __int64 ULong;
typedef unsigned __int32 UInt;
#else
typedef long Long;
typedef int Int;
typedef unsigned long ULong;
typedef unsigned int UInt;
#endif

void main()
{
ULong ull = 0xffffffffffffffff; // 18446744073709551615
}
[/cpp]

Does it work?

- Suman

--

Posted: Sun Mar 02, 2003 10:12 am
by Eric____
works! thanks!

but how do u print it out?

eric

I/O?

Posted: Sun Mar 02, 2003 5:41 pm
by suman
You mean I/O? Use cin or cout.
:wink:

-Suman