//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!"; //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(); };