Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Portability is a concern when using the fread() and fwrite() functions across multiple, heterogeneous systems. In particular, it is never guaranteed that reading or writing of scalar data types such as integers, let alone aggregate types such as arrays or structures, will preserve the representation or value of the data. Different compilers use different amounts of padding. Different machines use various floating-point models and may use a different Implementations may differ in structure padding, floating point model, number of bits per byte. In addition, there is always the issue of endiannessendianness, and other attributes that cause binary data formats to be incompatible.

Noncompliant Code Example

...