Programming

Write a C++ Program to Create a File

Write a C++ Program to Create a File

Source Code

#include<fstream>

#include<iostream>

using namespace std;

int main()

{

    ofstream outf("myfile.txt");

    outf<<"This is my first file handling program"<<endl;

    outf<<endl<<"This much for now"<<endl;

    outf.close();

}

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.