What is a portable way to writie a struct to a file in C?

前端 未结 3 735
你的背包
你的背包 2020-12-16 15:39

I need to serialize a C struct to a file in a portable way, so that I can read the file on other machines and can be guaranteed that I will get the same thing t

3条回答
  •  醉梦人生
    2020-12-16 16:06

    You could try using a library such as protocol buffers; rolling your own is probably not worth the effort.

提交回复
热议问题