Considering the fact that I did such Exercises for my own studies not a long time ago, I believe that providing you also with a thorough documentation might appeal to you. I will comment the code with explanations of how each function and concept (overview of the File I/O, structures etc) is being applied.