i am trying to make a program using functions
where i want a input,output,time,and charge all to be functions.
the problem i am having is with putting error checking into the function.
for example say i have this function below
void input (char,int,int)
and i want it to read in 2 times ( the ints) and a char from one of the following, but not output anything until the end of the program.
" choose one of the following "
" a is for apple "
"p is for pineapple"
say the user enters a K, which isnt valid.....how could i use a switch statement for this?
would it be something like this?
case A: (some statement here?)
case P: (some statement here?)
default: "Invaild data has been entered"
any ideas? thanks in advance........