I have a assignment and the professor provided us with the four functions we need to include. 2 void functions, and 2 value returning functions. The two value returning functions are ment to look as so:
1 2
string askText(const string& prompt)
int askNumber(const string& prompt="Enter a number: ")
I understand functions, but I have never come accross this prompt with in the function header. Could someone point me in the right direction on where I can find information on these? I have looked in both books required for the course and can find nothing concerning prompts. I have also tried searching the web, but I feel maybe I am calling this function the wrong thing, because I ending up on basic function help pages. Again with nothing concerning these prompts.
All this says is the default value of prompt is "Enter a number: ".
That means you can actually call askNumber like so: int example = askNumber();.
Note that there is no parameter. This is the EXACT SAME as saying: int example = askNumber("Enter a number: ");