14.8 DIRECT ACCESS FILES: SIMULTANEOUS READ WRITE

Earlier we said that a file can be opened for either reading or writing. This is a simplistic model of files. Nevertheless, it helps up in understanding and using files easily. In early days of computing, files were strictly sequential. Data were to be read from these file, processed and the output kept in another file. For example, employee's basic pay to be read as data file and salary statements (or salary slips) are written to output file. In that case, input and output files were distinct.

The scenario has been changed in the modern days. Databases have become common. Transaction processing has become “online”. It called for a file to be read and written simultaneously. In such a case, there ...

Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.