Is it possible (without an external library, for example boost) to request input from the user, for example, using cin, but with a default choice that can be changed by the user (without a GUI)?
For example, the program will say:
Give your input: default
and the user can press "enter" to use "default", or press 1, then enter "default1", etc.
EDIT for clarification:
What I have in my program provides a default value at the prompt (as in one of the answers below). But I write for special cases where the editable default value is extremely economical (and in 90% of cases all user needs add a suffix to the default). I can only request a suffix, but then I lost the flexibility to change the default value in another 10% of cases.
source
share