how mask=~(1<<i)??Did not understand
Clear and updates
@Ambuj-Singh-514796906079795
to clear i’th bit, you need something like 1111011 where i’th positiion is zero.
& will ensure the rest bits remain intact and i’th bit becomes zero.
to generate such mask :
You first generate 1<<i which is 0000100
and then you do “~” which toggles all the bits and mask becomes 0000100
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.