Data structures through files

How to store data structures in files, read them and do operations on them ?