ok im trying to read in this information which is in an input file.
Ray L. Jones 3942 6 4 1974 3 2 2001
Alice K. Brown 8300 4 8 1969 2 1 1999
Gill R. Alante 4301 8 2 1972 6 5 2000
Now here is my code:
Code:
#include <iostream>
#include <fstream>
#include <string>
using std::string;
using std::cout;
using std::endl;
int main()
{
ifstream inFile("input.dat", ios::in);
if(!inFile)
{
cout << "Could not open the file "
<< "for input.\n";
exit(1);
}
else
cout << "The file input.dat is open for
input.\n\n";
string firstName;
string lastName;
string middleInitial;
string employeeID;
string bmn; // Birth Month
string bdy; // Birth Day
string byr // Birth Year
string hmn; // Hire Month
string hdy; // Hire Day
string hyr; // Hire Year
for(int index = 0 index < 3; index++)
{
inFile >> firstName >> middleInitial >> lastName >> employeeID>>bmn
>>bdy>>byr>>hmn>>hdy>>hyr;
}
return 0;
}
I am using vc++ compiler and i keep gettin errors like 32 of them.
Can someone help me please.