This snippet asks the user to fill in a structure and saves each record to the file. It uses append mode to add each new record to the end of the file. After all input is taken, it prints out the contents of the file.
Disclaimer: fread and fwrite may not work portably between different implementations. Meaning, results may vary from platform to platform, compiler to compiler, or even with the same compiler with a different set of options or a different version.
Better code on the way(?).