I\'m trying to do some conversions between float and unsigned char arrays (std::vector in this case) and i\'ve run into some troubles.
I\'ve converted the vector of
Solved:
I think the problem was here
vector byteVec;
for (int i = 0; i < 3; i++)
byteVec.push_back(bytes[i]);
I removed that and replaced it with
vector byteVec(bytes, bytes + sizeof(float) * myFloats.size());
then the rest works fine!
Also, remember to use (bytes) instead of (*bytes) here
float* floatArray = reinterpret_cast(bytes);