Given c is an int, I don’t understand what the statement c = c & (1 << bit) does. Any help is highly appreciated!
Given c is an int, I don’t understand what the statement c = c
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It masks out everything but the
bit-th bit ofc.e.g. if
c = 27andbit = 3:and when
bit = 2:Note that the result will either be equal to
(1 << bit)(a power of 2) or0.