I think x&=~(1<<y) would set bit # y to 0 but I cant figure out how to set it to 1. I tried things like x&=(1<<y) but it sets all of x to 1 and not only the bit that I need.
Anyone know the correct algorith?
I think x&=~(1<<y) would set bit # y to 0 but I cant figure out how to set it to 1. I tried things like x&=(1<<y) but it sets all of x to 1 and not only the bit that I need.
Anyone know the correct algorith?
Thanks, it works. I was trying to fix that problem for 15 hours a day for 3 days and I was loosing all hope for making my program work.