I want to read file so that it should read integer by integer. I have read it line by line but i want to read it integer by integer.
This is my code:
void input_class::read_array()
{
infile.open ("time.txt");
while(!infile.eof()) // To get you all the lines.
{
string lineString;
getline(infile,lineString); // Saves the line in STRING
inputFile+=lineString;
}
cout<<inputFile<<endl<<endl<<endl;
cout<<inputFile[5];
infile.close();
}