If i want to use something like below in a C code:
如果我想在C代码中使用如下内容:
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.
我希望比较发生在一个长常量上,但是后缀LL在MSVC6.0中不能用,但是它在MS Visual Studio 2005中可以用。
How can i get it working in MSVC 6.0?
如何让它在MSVC 6.0中工作?
-Ajit
特的
3 个解决方案
#1
1
AFAIK, long long isn't supported in MSVC 6.0.
在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.
例如,看看这个讨论线程。也许,__int64作品。总之,我不知道用哪个后缀。
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.
编辑:__int64似乎可以工作,对于支持功能,似乎根本不需要任何后缀。看这里,例如。在这一页的最后还有一些变通的办法。
#2
1
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.
长型在1999年的ISO C标准中被标准化了,并且有望在今年或明年在c++中被标准化(无论何时标准最终确定)。就像所有这些标准特性一样,有早期的采用者和后期采用者。语言标准委员会通常不愿意包含以前没有尝试过的东西。
Visual C 6.0 was released in 1998, and therefore predates any standard with long long
in it.
visualc6.0是在1998年发布的,因此比任何长时间使用的标准都要早。
#3
0
I don't have a copy of VC 6.0 to check, but does i64 work? (e.g. 12i64
)
我没有vc6.0的拷贝要检查,但是i64行吗?(如12 i64)
#1
1
AFAIK, long long isn't supported in MSVC 6.0.
在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.
例如,看看这个讨论线程。也许,__int64作品。总之,我不知道用哪个后缀。
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.
编辑:__int64似乎可以工作,对于支持功能,似乎根本不需要任何后缀。看这里,例如。在这一页的最后还有一些变通的办法。
#2
1
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.
长型在1999年的ISO C标准中被标准化了,并且有望在今年或明年在c++中被标准化(无论何时标准最终确定)。就像所有这些标准特性一样,有早期的采用者和后期采用者。语言标准委员会通常不愿意包含以前没有尝试过的东西。
Visual C 6.0 was released in 1998, and therefore predates any standard with long long
in it.
visualc6.0是在1998年发布的,因此比任何长时间使用的标准都要早。
#3
0
I don't have a copy of VC 6.0 to check, but does i64 work? (e.g. 12i64
)
我没有vc6.0的拷贝要检查,但是i64行吗?(如12 i64)