I have an array of floats with a fixed length. Now I want to convert that array to a binary string.
I cannot use const char * because my string will contain null-bytes. How would I use memcpy in that case? I have already tried a reinterpret_cast<string *>, but that won't work because the string is also/only storing pointers to the begin and end of the data (correct me if I am wrong).
I'm already constructing an empty string:
string s;
s.resize(arr_size);
But how would I copy an array of floats to that string?
Basically, I want to dump the memory region of a fixed float array to a string.
Don't be to hard with me, I'm still learning c++