so i have a txt file and the first line is “Rain Fall Average”
what code can i use to read the first line and then display it on the console window.
this is what i have so far.
#include
#include
using namespace std;
int main()
{
ifstream inputFile;
char study_name[71]; //NOTE – study name must contain up to 70 character//
inputFile.open(“c:\\rainfall.txt”);
cout << "Reading data from file" << endl;
inputFile >> study_name; //Problem here – It only displays “Rain”//
cout << study_name << endl;
inputFile.close();
//is it possible displaying the title with a char variable or must i use a string //