![]() Std::string tohexed = ToHex(std::string(memblock, size), true) ![]() ![]() Is there a way to get the same desired output using C++? Ret << std::hex << std::setfill('0') << std::setw(2) << (upper_case ? std::uppercase : std::nouppercase) << (int)s Std::string tohexed = ToHex(memblock, true) Ĭonverting to hex: string ToHex(const string& s, bool upper_case)įor (string::size_type i = 0 i < s.length() ++i) Ifstream file (toread, ios::in|ios::binary|ios::ate) Ĭout << "the complete file content is in memory" << endl What I've tried so far: ifstream::pos_type size I'm having some problems reading a binary file and converting it's bytes to hex representation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |