There's a few things wrong with your code, unless I've really misunderstood what you're up to (which is possible...).
The first one is that when you write:
void aChoice();
or
void pChoice();
you're prototyping the functions, not calling them. If you really want to call them you need to knock the
void
off the front.
I'd assume you mean
aChoice
in the second conditional statement as well. While the code you've got may compile (not sure of the rules for converting function pointers to arbitrary pointers) what it looks like you're doing is comparing the address of the function
pChoice
with a couple of characters. It might be worth cranking up your compiler warnings to the top level (/W4 /WX on Visual C++) as that might give you some more guidance.
Now, having sorted that out... What it looks like you want to do is loop around while the user hasn't entered what you expected him or her to, otherwise you want to execute one of the functions and bail out of the program. If you don't want to bail out then you don't want to do what I'm going to suggest!!
So how do you loop until the input is what you expect? I'd be tempted to use a while loop (a do/while might actually work better, I'm just a bit adverse to them for no logical reason I can put my finger on). The conditional for the while loop is similar to the two conditions you check later:
char aChoice = ' ';
while( ( aChoice != 'A' ) && ( aChoice != 'a' ) && ( aChoice != 'P' ) && ( aChoice != 'p' ) )
{
}
Now while this code is okay, it's a bit of a bugger to read. My eyes when crosseyed while reading it. You might want to look at hiding the conditionals in other functions to make it easier to read. Another technique you could look at might be a jump table but that's probably overkill for this sort of problem.
Cheers,
Ash