long long llIdx = foo();
if (llIdx > 0LL) // Can I use 0 here?
...
Is there any problem if I use 0 instead of 0LL in above code?
When should I prefer 0LL over 0?
Yes, you can use a plain 0 here. The compiler would look at the type of each argument to > and promote the smaller one so that they are the same size.
Thus llIdx > 0 and llIdx > 0LL are equivalent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With