@SpaceK33z wrote:
I’m using ofxLibwebsockets to receive an array of 32-bit floats as binary (JSON is too slow for my usecase).
From ofxLibwebsockets I get an
ofBuffer
variable that I have saved asbuffer
:char *data = (char *)buffer.getData(); int size = buffer.size() / sizeof(float); for (int i = 0; i < size; i++) { std::cout << data[i] << endl; }
I would expect this to output each float value from the array, but instead it outputs random values like
\312
. I’m a complete beginner in C++ but after searching like crazy I still cannot find how to do this. Any pointers (pun intended)?
Posts: 3
Participants: 2