#include
#include
using namespace std;
int main ()
{
char buffer[256];
fstream myfile;
// open it for input and read in
myfile.open("test.txt",ios::in);
myfile.getline(buffer,100);
cout << "The file contains " << buffer << "\n";
myfile.close();
return 0;
}
The file contains This outputting a line.