ifstream infile;
string read_file_name("test.txt");
infile.open(read_file_name);
string sLine;
while (!infile.eof())
{
getline(infile, sLine);
cout << sLine.data() << endl;
}
infile.close();
This program prints all line in the file, but I want to print only first line.