Im a cs major, and I am having trouble with a lab assignment. I'm hoping someone here can give me a hand! We are working with input/output files right now, and I have managed to create an infinite loop using while(!in_stream.eof()). We are writing in c++. Here is my code
while(!in_stream.eof())
{
getline(in_stream,Name);
in_stream >> salary;
taxes = GetTax(salary);
totalTax += taxes;
totalSalary += salary;
grossSalary += (salary - taxes);
printSalary(out_stream, Name, salary, taxes, count);
getline(in_stream,Name);
in_stream >> salary >> moveOn;
cout << "ok" << endl;
}
I feel i'm hitting the loop because I'm missing the \n character at the end of a line, but that is why I'm using moveOn. I'm hoping the moveOn Char will catch it, but it doesn't seem to be working. Thanks in advance!
EDIT: that cout statement is there so I can discern whether or not the loop has ended.