IO issue!

On line cout << hydraTxt << "-----" << endl; for some reason it outputs the last entry twice and I cannot see why
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
void readIn(HydraRecord hr[], int length){
	string hydraTxt = "hydraIndex.txt";
	const char * const cString = hydraTxt.c_str();
	ifstream infile;
	infile.open(cString); 
	int count = 0;
	while(infile){
		infile >> hydraTxt;
		cout << hydraTxt << "-----" << endl;
		const char * const cString = hydraTxt.c_str();
		ifstream subinfile;
		subinfile.open(cString);
	while(subinfile){	
			int count = 0;
			subinfile >> hr[count].customerId >> hr[count].name.firstName >> hr[count].name.lastName 
				 	  >> hr[count].address.streetAddress >> hr[count].address.city >> hr[count].address.state
					  >> hr[count].address.zipCode >> hr[count].phoneNumber 
				   	  >> hr[count].date.day >> hr[count].date.month >> hr[count].date.year
				   	  >> hr[count].phoneNumber >> hr[count].balance.checking >> hr[count].balance.savings;
		
			
			
		}
		count++;
Last edited on
Topic archived. No new replies allowed.