C++ Writing to file

C++ File Handling write() Function

In file handling, write() function is used to write data into the file. The write() uses ofstream or fstream library to write into the file.

Syntax

The write() takes two arguments. The first argument is the address of variable var and the second argument is the size of variable var in bytes.

Example

C++ File Handling write() Function Example

Output:


Leave a Comment