![]() ![]() TO DO: write the bits represented as a string of chars '0' or '1' into the file bool write_bits( const std::string& file_name ) // return true on success // print the bits (default: to stdout) in a human readable form using bits = std::bitset // bitset of bits in one byte // if the file was successfully opened for input (note: binary mode) if( std::ifstream file // read failure: return an empty string Std::string read_bits( const std::string& file_name ) return the bits read from the file represented as a string of chars '0' or '1' BITS_PER_BYTE = 8) // constexpr std::size_t BITS_PER_BYTE = std::numeric_limits::digits #include #include #include #include using byte = unsigned char // C++17: we can use std::byte if we please // number of bits in a byte (in practice, a byte is an octet ie.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |