The file position indicator determines which part of a file is read or written to. For sequential file access, the file position indicator moves forward through a file until the EOF is encountered. For random file access, the fseek() function is used to manipulate the file position indicator and read from various spots in a file. To best use random file access, specific-size chunks of data must be stored in the file.
- [Instructor] When a file is opened … for reading or writing … the operating system uses a file position indicator … to keep track of where data is written to … or read from in the file. … Sequential file access reads from or writes to … a file one byte after another. … The file position indicator keeps moving forward … until the EOF is encountered … or the FEOF function returns true for a given file handle. … With random file access, … the file position indicator can be set … to any location in a file to read or write data. … This feature works best for files that contain … uniform data, such as a file of integer values, … structures, or similar consistent data. … The fseek function controls the file position indicator. … Its three arguments are the file handle or stream, … a long integer offset representing … the offset within the file, … and a constant as the third argument representing … from whence the offset is measured. … Seek_set from the start of the file. … Seek_cur from the current …
- Working with arrays
- Building a structure
- Creating an array of structures
- Testing characters
- Working with strings in C
- Using pointers to manipulate data
- Manipulating files
- Using command-line arguments
- Working with time functions
Skill Level Intermediate
1. Arrays and Structures
2. Characters and Strings
4. Files and the Operating System
5. The Interesting and Extraordinary
Next steps1m 52s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.