This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center




7年前关闭。




我正在阅读一些C++代码,但碰到了这条奇怪的线。

这是一行:
if (!k || !n || !m) return min((ll)tot, m*(1LL << n));

1LL似乎在这里得到了答复:What is 1LL or 2LL in C and C++?

我想知道的是(ll)tot [2个小L's]到底是什么?它是某种形式的类型转换吗? tot是全局整数变量。

有人可以启发我,或引导我去一些资源,在这里我可以了解到(ll)variableName的确切含义。

提前致谢。

最佳答案

如前所述,它可能不是11(十一),而是ll(双L)。您可以尝试搜索

#define ll long long

在该代码中:)

它也可以是自定义对象。
class ll { ... };

或简单的typedef别名
typedef long long ll;

(感谢用户0x499602D2提及此解决方案)

关于c++ - 这是C++类型转换的某种形式吗? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16874556/

10-12 20:37