Q:

Comparing long long with 0

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?

A:

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.

