can anyone show how to correctly convert binary represented data to a double value in C. for example, I have 8 unsigned char values that will be converted to a double value (let it be called a buffer). therefore, buffer bit [0] 0 is LSB, and buffer [7] is 7 bits is MSB. Thanks a lot in advance!
Just quit think
char buf[8]; double x; ... x = *((double*) buf);
IF : ALL true:
sizeof(double) == 8
8 (, "fd" - ):
char bytes[8]; fread(&bytes, 8, 1, fd); double d = *((double*)bytes);
, , . , , , , , , . - - UTF-8, , .
Source: https://habr.com/ru/post/1758995/More articles:UIAlertView with Two Buttons on iPhone - iosasp.net ashx handler requests download instead of displaying file - asp.netURL in JOptionPane - javaJava JDBC Получить идентификатор после вставки - javaJava recurring task, date issue - javaInstantationException in newInstance of an anonymous class created - javaNSFetchRequest setFetchOffset in NSFetchedResultsController - iphoneStop select.change from sending back - javascripthow to add ajax on django admin - djangoFlash cannot trigger any events on URLLoader - flashAll Articles