I need help with my program its not reading information from my file
here is the code i have:
how do i fix it to make it read the file.
here is the code i have:
how do i fix it to make it read the file.
Code:
#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
#include <cmath>
using namespace std;
int main()
{
int numberOfPassengers;
int month;
int day;
int year;
char junkChar;
string lastName;
string firstName;
int theNumberOfBags;
int weightOfBags;
int lengthOfBags;
int heightOfBags;
ifstream inFile;
inFile.open("F:\\data3.txt");
for (int i=1; i<=numberOfPassengers; i++)
{
inFile >> month;
inFile >> junkChar;
inFile >> day;
inFile >> junkChar;
inFile >> year;
inFile >> lastName;
inFile >> firstName;
inFile >> theNumberOfBags;
inFile >> weightOfBags;
inFile >> lengthOfBags;
inFile >> heightOfBags;
}
inFile.close();
return 0;
}
Comment