file

PHOTO EMBED

Tue Apr 27 2021 00:31:01 GMT+0000 (Coordinated Universal Time)

Saved by @ahmedqgqgq #java

//Read from the file.
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
	//Create a text file.
	ofstream Mywritefile("fileAhmed.txt");
	//Write to the file.
	Mywritefile << "Ahmed abdelmoneim!\nmohamed";
	//Close the file.
	Mywritefile.close();
	//Create a text string,
	string myText;
	//read from the text
	ifstream Myreadfile("fileAhmed.txt");

	while (getline(Myreadfile, myText))
	{

		cout << myText;
	}
	
	Myreadfile.close();
};
content_copyCOPY