I have a couple of question about the Converting a string to binary article on this site.
First of all, CHAR_BIT - Is this a const int = 8 ? Im assumiong it's been declared in one of the headers.
Secondly, this code snip is found in the print_bits method
Whats the point of using two ! when doing the cout ?Code:for ( unsigned i = 0; i < n_bits; ++i ) { std::cout<< !!( val & 1 ); val >>= 1; }
whats does val >>=1 do ?
appreciate any response.