This does not do what you think it does. "clear" merely removes the errors
status from your stream. It does not remove any corrupt data, or empty your stream or anything like that. If you are trying to read an int, and the data in your stream is "apples", you will fail forever.
This is what you need to do:
Code:
std::cin.clear(); //Remove error status
std::cin.ignore(255, '\n'); //Remove any data left in the stream.
Or just read this guide. I really think you need it. It'll help.
http://www.parashift.com/c++-faq-lit....html#faq-15.3
On a side note, I really think you need to try to learn the "C++ way" of doing things, rather than the "C way".
Also, try concentrating on the scope of your variables, and what they should be. For example, the variable "choice" is global, but mchoice is not?
Another weird thing in your code is that every now and then you write things like:
Code:
cout<<"Birth Year is not valid"<<endl;
(atoi(birthyr)) == 0;
or
memset(wrkhrs, 0, sizeof(wrkhrs));
credit=0;
choice==0;
system("cls");
return SingleEnq();
What exactly do you think this does? I think the first one does not do what you want (I don't know what you want though), and the second one,
might be a typo'ed = turned ==.
Finally, as we said, don't work with char arrays (or string). If your data represents a number, put it in a number, and work with that. Don't atoi() every time you need the birthyear. This is just god awful:
Code:
age = curryr - atoi(birthyr);
I can't really help you more, since you never even said what was wrong, which is basically the first thing you should have told us...