Hallo,
nur eine Konstante, die das zu prüfende Bit widerspiegelt.
Oder zur Laufzeit einen Wert erzeugen:
1 << (position_von_rechts - 1)
das Prinzip ist mir auch geläufig, nur die "-1" ist da irgendwie fehl am Platz. Damit würdest du ja für das Bit 0 einen Schiebe-Zähler von -1 erhalten!
Ich weiß, immer dieses Plus/Minus-Eins-Problem ... ;-)
So long,
Martin
--
Most experts agree: Any feature of a program that you can't turn off if you want to, is a bug.
Except with Microsoft, where it is just the other way round.
Most experts agree: Any feature of a program that you can't turn off if you want to, is a bug.
Except with Microsoft, where it is just the other way round.