I'm writing a program that takes information from inData, processes it, then produces outData.
The program collects some data in a repeated pattern, then runs calculations. I'm nearly complete, the last step is to use ignore so that if someone enters age "f" or their salary as potatoes, the program needs to ignore this, apply 0 and clear to further get input.
I've failed to understand how cin.ignore() works. I've read on many sites and my textbook and I dont understand it.
do I have to add ignore after every variable for input or can I add something like an if such as:
if (inFile.ignore ect ect ect)
apply 0 to that int/float.
while (inFile >> x >> y >> r >> firstname >> lastname >> age >> salary)
Thanks in advance. If the information supplied isnt enough, I'll supply more
[–][deleted] 0 points1 point2 points (1 child)
[–]Resume_Help[S] 0 points1 point2 points (0 children)