i would like to know if this is possible...
I know that 255 = 11111111 and if i do 255 << pos*8 with pos=1 i will have 1111111100000000.
I would like to know if is possible to get the value 1111111111111111 with shift left without doing a cicle while or for.
Thanks.
int output = (input << shift) | ((1 << shift) - 1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With