Take this line of code for example:
for(int i=n-1; ~i; --i)
My question is what does the ~i mean. What I already know is the for loops needs the following:
for (type var = ; condition; something to do with var) {
code here
}
But how is ~i a condition?
All I know is ~i returns the bitwise complement of i, or flip the bits.