Create a File | CPP Program
source link: https://www.geeksforgeeks.org/videos/create-a-file-cpp-program/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Create a File
- 90 Views
- 16/07/2022
In this video, we will see how to create a file in C++.
File handling in C++ includes the following:
1) Create a file
2) Naming a file
3) Opening a file
4) Writing data into the file
5) Reading data from the file
6) Closing a file
Here in this video we cover three different classes for file stream operations:
1) ifstream
2) ofstream
3) fstream
ifstream: It provides input operations. This class contains open() function with default input mode. Inherits the functions get(), getline(), read(), seekg() and tellg() functions from the ifstream.
ofstream: ofstream class provides output operations. This class contains open() function with default output mode. Inherits the functions put(), write(), seekp() and tellp() functions from the ostream.
fstream: fstream class provides support for simultaneous input and output operations.
CPP Program to create a file: https://www.geeksforgeeks.org/c-program-to-create-a-file/
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK