long long 常量的后缀是什么
如果我想在 C 代码中使用如下所示的内容:
if(num < 0x100000000LL)
我希望比较发生在 long long 常量上,但是后缀 LL 在 MSVC6.0 中不起作用,但它在 MS Visual Studio 2005 中起作用。
我怎样才能得到它在 MSVC 6.0 中工作吗?
-阿吉特
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
AFAIK,MSVC 6.0 不支持 long long。
例如,看看这个讨论线程。 也许,__int64 可以代替。 无论如何,我不知道该使用哪个其他后缀。
编辑: __int64 似乎可以工作,并且对于支持功能,似乎根本不需要后缀。 例如,请查看此处。 本页末尾还有一些解决方法。
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.
long long
类型已在 1999 年 ISO C 标准中标准化,预计今年或明年(无论标准何时最终确定)将在 C++ 中标准化。 与所有这些标准功能一样,也有早期采用者和晚期采用者。 语言标准委员会通常不愿意包含以前没有尝试过的东西。Visual C 6.0 于 1998 年发布,因此早于其中包含
long long
的任何标准。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.我没有 VC 6.0 的副本可供检查,但 i64 可以工作吗? (例如
12i64
)I don't have a copy of VC 6.0 to check, but does i64 work? (e.g.
12i64
)