char getChoice(const char* prompt, const char* allowed);
display prompt and get user input (a char)
if user entered a valid char (it is within "allowed" string),
then return that char
if char is not valid, display error and repeat until a
valid character is entered
This is an assignment my brother had from his old C++ class, and I was
trying to teach myself how to code.
The above is a chunk taken from the assignment. I was wondering how I
would write this. The confusing point for me is the const char*
prompt and const char* allowed, i don't understand the purpose or
function of those statements.
I know how to call, declare, and define a function, I just need help
understanding the const char* purpose.
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


|