Writing to a File using Ofstream class
This video tutorial explains how to write to a file using an ofstream class object.
You are gonna learn how to create an object of ofstream class, how to open a file for writing, how to associate a file with an object of ofstream class, how to write to the file using stream insertion operator in detail with example.
source code for this tutorial
#include#include using namespace std; int main() { ofstream file("anil.txt"); if(!file.is_open()){ cout <<"unable to open the file"<