In C, bit positions are 0-indexed.
1 << 0 → least significant bit (LSB)1 << 5 → the 6th bit if you count from 1.
If you really want to toggle the 5th bit counting from 0, it 1 << 5 is correct.
If you want to toggle the 5th bit counting from 1, you should use 1 << 4.