Sequential File Organization in C++
The file stream classes support some member functions for performing the input and output operations on files.
put() and get() functions:
The function put() writes a single character to the associated stream. Similarly, the function get() reads a single character from the associated stream.
write() and read() functions:
The functions write() and read() is unlike the put() and get() functions. It handles the data in binary form. It means that the values are stored in the disk file in the same format in which they are stored.
1. seekg(): It moves to get a pointer (input) to a specified location.
2. seekp(): It moves to put a pointer (output) to a specified location.
3. tellg(): It gives the current position of the get pointer.
4. tellp(): It gives the current position of the put pointer.