My program is suposed to input infromation from two files than calculate the taxes, and print out the info on the screen. The problem is when I try to input information from one of my files it will run through the while loop and take in the getline, but it won't do it again, and again like it's supposed to. It just keeps cycling the loop, without running the getline.
************************************************** *
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main()
{
string customerf = " ", customerl = " ", state = " ", statetax = " ";
int times;
double amount, paid, rate, total = 0;
blah...
blah...
blah...
getline(instatetax, statetax, '#');
instatetax >> rate;
while (statetax != state)
{
getline(instatetax, statetax, '#');
instatetax >> rate;
}
blah...
blah...
blah...
Input file looks like
AL#.056
AK#.095
AZ#.O625
AR#.045
CA#.08
CO#.0725
CT#.0775
DE#.O7
FL#.0725
GA#.055
HI#.0875
ID#.06
IL#.065