阅读背景:

我应该如何用C语言写一个结构?

来源:互联网 

I'm trying to write a struct to a binary file. I want my code to be cross platform, so I'm not sure about just writing the whole struct with a fwrite. If I did this, then the size of the struct will vary depending on the size of the primitive types for each platform(in platform A, an int won't have the same size as in platform B. So the struct won't be the same size either, and the file will end up being different). I'm trying to write a struct to a binary file.




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: