I am reading in from a file and when I use .eof() it read everything from the file the I get a run time error of
Exc-Bad-Access. When I run a for loop instead the program runs with not errors. Any hints?

while (!inputFile.eof()) {
		
		inputFile>>number>>lowerRange>>higherRange>>cond>>aFName>>aLName>>phase;
		active=(cond=='t');
		sAds[i] =  SequenceAds(number, lowerRange, higherRange, active, aFName, aLName, phase);
		cout << sAds[i].getCost()<<" "<<sAds[i].getRangeLower()<<"-"<<sAds[i].getRangeHigher()<<" "<<sAds[i].getState()<<" "<<endl;
		i++;
		
	}

here is what is is reading in
45.85 54 74 t Interpublic Group introductory
31.84 20 50 f Mother Advertising end
22.90 18 25 t Pappas Group middle
40.30 65 80 t Omnicom Group end
22.15 50 64 f Grey EMEA introductory

I can include more code it it might help

The problem should be related to the one pointed out in this post.
Post whole code for the SequenceAds class.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.