Example of program input from file
Example of program input from file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
using namespace std;
int main()
{
// Create a text string, which is used to output the text file
string myText;
// Use a while loop together with the getline() function to read the
file line by line
while (getline (MyReadFile, myText)) {
// Output the text from the file
cout << myText;
}
return 0;
}