[try Beta version]
Not logged in

 
C++ Functions

Oct 4, 2018 at 8:12pm
I need help in this question

Write a function prototype for a function that prompts the user to type a number, which is then returned as a result. The text of the prompt that the user sees is a function argument, but if that message is not provided the default message is Enter a number:
Oct 4, 2018 at 8:25pm
A function prototype is just a declaration.

int function(); is a suitable prototype for the function you have described.
Oct 4, 2018 at 8:46pm
Actually don't forget the required parameter: int my_function(std::string_view message = "This is my default message: ");.

Topic archived. No new replies allowed.