[prev] [index] [next]

Reading/Writing Dynamic Structures

You cannot write-then-read pointer values.

Pointer values refer to memory configuration in one process.

Subsequent processes may have different configuration.

What you can do for linked structures:

  • write individual nodes one after another in file
  • read values back into newly-malloc'd node structs
  • ignore any pointer values that were written to file
  • set links to reflect new locations of node structs