Monday, May 10, 2021

simple program using ofstream in file handling (OOP) (92)

#include<iostream>

#include<fstream>

using namespace std;

int main()

{

ofstream obj;

obj.open("ofstreamExample.txt");

cout<<"this program is the example of ofstream :"<<endl;

obj<<"file has been created:"<<endl;

obj<<"this program is the example of ofstream:"<<endl;

obj<<"with the use of ofstream you can write data in this file:"<<endl;

obj.close();

} 

No comments:

Post a Comment