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

Can you give a sample of what you are trying to read in?

I am trying to have this read into the constructor

24.98 25 50 True
32.43 30 60 False
42.75 50 70 True

Dont know if this is your original code but there's no closing curly brace at the end of the for loop

included the curly bracket in my program forgot to put when I posted it

It's choking on reading the true or false values. When reading a bool from a file it's looking for a 0 or (EDIT: only works for 1) a 1 as false and true.

Read in "true" or "false" from your file as a string and then convert it to boolean true or boolean false.