I need to convert a string into a string with the binary code of the first string. For the first part i used this: Fastest way to Convert String to Binary? Worked perfectly but i can't figure out a way to write it into a new string.
Here's the code i'm using so far:
for (size_t i = 0; i < outputInformations.size(); ++i)
{
cout << bitset<8>(outputInformations.c_str()[i]);
}
Output:
01110100011001010111001101110100011101010111001101100101011100100110111001100001011011010110010100001010011101000110010101110011011101000111000001100001011100110111001101110111011011110111001001100100
Is there a way to write this into a new string? So that i have a string called "binary_outputInformations" with the binary code inside it.