Some intersting BUG (C code)
Hello everyone, I planned to learn more about bitwise operations in C. I've started to write some code for playing with bits and got some bug. I don't understand where is it. So it's only the first part of the code, where User input a integer (I will be using it as a bit field for operations with bits), and another integer ( it will be the number of a bit in 32 bits integer that I will be use as a bitmask) and the last integer - is flag for bitmask (ON or OFF). So the problem: When user entered the third integer (var flagBit) the previous integer (var numBit) is equal zero. For example. I enter 10 for first integer (var number), 2 for second (var numBit), and 1 for third (var flagBit). At the and of the code the values of the vars are: var number ==10 var numBit == 0 var flagBit == 1. And I really don't understand why!!! Here is my code: https://code.sololearn.com/cmCQtALrAwr0