I want to read in multiple lines from a file, but I am only able to get my program to read the first line. The program prints out two other lines but the values are zero.
double cost[3];
int lowerRange[3];
int higherRange[3];
bool active[3];
ifstream inClientFile("ad.txt", ios::in);
for (int i=0; i<3; i++) {
(inClientFile>>cost[i]>>lowerRange[i]>>higherRange[i]>>active[i]);
Ad ad(cost[i], lowerRange[i], higherRange[i], active[i]);
cout << ad.getCost()<<" "<<ad.getRangeLower()<<" "<<ad.getRangeHigher()
<<" "<<ad.getState()<<endl;
What I am trying to do is get the file to read in four values, send them to the constructor and then prints them out. Any help is appreciated