I working on a program and I using a while loop. My while loop has to read information from a file. the file contains three lines with names, and a bunch of numbers and dates.
the problem that I am having is that my the program is not reading the dates
which are month/day/year
how can i fix that to make the dates apear.
heres is what i have:
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <cmath>
using namespace std;
int main()
{
int month;
int day;
int year;
char junkChar;
string sampleInput;
ifstream inFile;
inFile.open("F:\\people.txt");
while(!inFile.eof())
{
inFile>> sampleInput;
getline(inFile,sampleInput,'\n');
if ( sampleInput=="")
{
cout << endl;
}
else
cout << sampleInput << endl;
}
cout << endl;
inFile.close();
return 0;
}