The statement ++i == i++ is actually undefined
Wrong. ++i == i++ Because: First, you increase i by 1 and then let it check with the same value which has already been increased by 1 which, after the check, will be increased again.