#include <iostream>
#include <fstream>//Used for file handling.
using namespace std;
int main(){
ofstream outfile;
outfile.open("rehan.txt");//This file will be created in the directory in which you've created your project.
outfile << "My name is Rehan\nand I love to play football" << endl;
cout << "File Written" << endl;
return 0;
}
See also:
No comments:
Post a Comment