Assuming I have char “C” whose ascii code is 0110 0111. How can I iterate over its bits? I would like to build a vector from these 1’s and 0’s….
Assuming I have char C whose ascii code is 0110 0111 . How can
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.
You can easily iterate over them using bitwise operators:
you can optimize it (as suggested in comments):