#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main(void) {
float freq_rang=1.234;
char msg[100] = {0};
*((float*)&msg[3]) = (float)(htonl(freq_rang));
printf("%02x %02x %02x %02x \n", msg
[3],msg
[4],msg
[5],msg
[6]);
memcpy(&msg
[3], &(float){htonl
(freq_rang
)}, sizeof(float));
printf("%02x %02x %02x %02x \n", msg
[3],msg
[4],msg
[5],msg
[6]);
return 0;
}
I2luY2x1ZGUgPGZjbnRsLmg+CiNpbmNsdWRlIDx1bmlzdGQuaD4KI2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGUgPHN0cmluZy5oPgojaW5jbHVkZSA8c3RkZGVmLmg+CiNpbmNsdWRlIDxzeXMvdHlwZXMuaD4KI2luY2x1ZGUgPHN5cy9zb2NrZXQuaD4KI2luY2x1ZGUgPG5ldGluZXQvaW4uaD4KCmludCBtYWluKHZvaWQpIHsKCQoJZmxvYXQgZnJlcV9yYW5nPTEuMjM0OwoJY2hhciBtc2dbMTAwXSA9IHswfTsKCgkqKChmbG9hdCopJm1zZ1szXSkgPSAoZmxvYXQpKGh0b25sKGZyZXFfcmFuZykpOwoJCglwcmludGYoIiUwMnggJTAyeCAlMDJ4ICUwMnggXG4iLCBtc2dbM10sbXNnWzRdLG1zZ1s1XSxtc2dbNl0pOwoJCgltZW1jcHkoJm1zZ1szXSwgJihmbG9hdCl7aHRvbmwoZnJlcV9yYW5nKX0sIHNpemVvZihmbG9hdCkpOwoKCXByaW50ZigiJTAyeCAlMDJ4ICUwMnggJTAyeCBcbiIsIG1zZ1szXSxtc2dbNF0sbXNnWzVdLG1zZ1s2XSk7CgoJcmV0dXJuIDA7Cn0K