作者:zoey小 | 来源:互联网 | 2023-05-18 15:10
Hmm,hello!Iamtryingtoreadabinaryfilethatcontainsanumberoffloatvaluesataspecificp
Hmm, hello! I am trying to read a binary file that contains a number of float values at a specific position. As seemingly must be done with binary files, they were saved as arrays of bytes, and I have been searching for a way to convert them back to floats with no success. Basically I have a char* memory block, and am attempting to extract the floats stored at a particular location and seamlessly insert them into a vector. I wonder, would that be possible, or would I be forced to rely on arrays instead if I wished to save copying the data? And how could it possibly be done? Thank you ^_^
嗯,你好!我试图读取一个二进制文件,其中包含特定位置的许多浮点值。由于看似必须使用二进制文件,它们被保存为字节数组,我一直在寻找一种方法将它们转换回浮点数但没有成功。基本上我有一个char *内存块,并试图提取存储在特定位置的浮点数并将它们无缝地插入到矢量中。我想知道,如果我希望保存复制数据,那么这是可能的,还是会被迫依赖数组呢?怎么可能这样呢?谢谢^ _ ^
1 个解决方案