How to convert float to byte array of length 4 (array of char*) ? I need to send over network some data, tcp, and need to send float as a byte array. ( I know precision to two d
Just overlay the data in one area, in C
union dataUnion { float f; char fBuff[sizeof(float)]; } // to use: dataUnion myUnion; // myUnion.f = 3.24; for(int i=0;i