views:

891

answers:

3

Hello,

If i want to use something like below in a C code:

if(num < 0x100000000LL)

I want the comparison to happen on a long long constant, but suffix LL doesn't work in MSVC6.0 , but it works in MS Visual Studio 2005.

How can i get it working in MSVC 6.0?

-Ajit

A: 

AFAIK, long long isn't supported in MSVC 6.0.

For example, have a look at this discussion thread. Perhaps, __int64 works instead. Anyway, I wouldn't know which other suffix to use.

EDIT: __int64 seems to work and for the supporting functions, it seems that no suffix is needed at all. Have a look here, for example. There's also some workaround at the end of this page.

schnaader
By the way, this is one of the reasons why I switched to gcc.
schnaader
A: 

I don't have a copy of VC 6.0 to check, but does i64 work? (e.g. 12i64)

Andrew Khosravian
A: 

The long long type was standardized in the 1999 ISO C Standard, and is expected to be standardized in C++ this year or next (whenever the standard is finalized). Like all of these standard features, there have been early adopters and late adopters. Language standards committees are usually reluctant to include things that haven't been tried before.

Visual C 6.0 was released in 1998, and therefore predates any standard with long long in it.

David Thornley