< Prev
Next >

C++ Binary read() and write() Functions

In our last few article, we have explained how to use get() and put() functions to read and write a character to/from a file on the disk. In this tutorial, we are going to explain how to use the a very important a binary input/output functions named read() and write().

Binary I/O Functions Description
This binary function is used to perform file input operation i.e. to read the objects stored in a file.

This binary function is used to perform file output operation i.e. to write the objects to a file, which is stored in the computer memory in a binary form.

Only the data member of an object are written and not its member functions

Before we show you how to use this binary input/output functions to write and read the object to file on the disk, we must show you how to open the file. For this, the C++ language provides us stream classes used to perform file input/output operation.

File I/O Stream Classes

In order to perform a binary input/output operation using the read() and write() functions, C++ provides us a few file stream classes, such as -

Please Subscribe

Please subscribe to our social media channels for daily updates.

Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page



Please check our latest addition