In this chapter, the file handling APIs were discussed with examples provided for each. The character interfaces were first explored ( fputc , fgetc ), followed by the string interfaces ( fputs , fgets ). Some of the more structured methods for generating and parsing files were then investigated (such as the fprintf and fscanf functions), in addition to some of the other possibilities ( sprintf and sscanf ). Finally, the topics of binary files and random (nonsequential) access were discussed, including methods for saving and restoring file positions .