How to read a float from binary file in C?

前端 未结 7 735
挽巷
挽巷 2020-12-10 17:31

Everything I\'m finding via google is garbage... Note that I want the answer in C, however if you supplement your answer with a C++ solutio

7条回答
  •  佛祖请我去吃肉
    2020-12-10 17:57

    If these values are sequentially placed into a binary file you can do a read of sizeof(float) bytes per float value into a character array. You can then cast these into a float value.

提交回复
热议问题