The OssBitString takes in string length (in bits) and a const unsigned char* as parameters. However, when I convert the input std::string to const unsigned char* and pass it to OssBitString, the contents of the string get modified and contains weird characters. The following is the conversion function from std::string to OssBitString:
inline const OssBitString converter(const std::string&s, int size)
{
return OssBitString(size, reinterpret_cast<const unsigned char*>(s.c_str()))
}
I am not sure how to proceed. Also,I tried to convert the string into binary format and then convert as a OssBitString as well. But it did not work. How to convert std::string to OssBitString then?