Now, I've had quite a lot of trouble with stupid errors in my time. My time, which is very limited. I'm a fairly new programmer, and I have a situation here. I'm all good up to where I enter 'P' or 'R'. Entering an invalid character will loop back and ask for another input just fine. However, when entering a valid character, the program ends. I have no idea why it it completely missing the switch structure/the rest of int main(). I added a test at the end to see if it would just skip the switch or the entire int main, and I found out it skips the entire main function after sending back (or attempting to send back sevtype.)
I've even stumped my instructor on this one. Help is more than appreciated.
int main()
{
welcome();
choice(sevtype);
switch (sevtype)
{
case'r':
case'R':
//void reg(); Don't do this, this is like delaring a header
reg(//Needs an amount in here);
break;
case'p':
case'P':
//void pre(); Don't do this either
pre(//Needs an amount in here);
break;
default://without this, the function below will not execute
//If you need to call that function regardless of options above
//then you might want to call the function before the breaks in
//the above cases
//ex reg(double& somenum);
// cou();
// break;
//void cou();
cou();
}
}
This means you have to redo your function headers as: