I want to simplify user input of parameters to a programme by offering default values - ie if the user just presses Return the default value is assigned. The input section should be something like this:
The problems areCode:float sym_size; cout << "Input symbol size in cm (default = 0.1cm): "; cin >> sym_size; if (xxxxxxxxxxxxxxxx) { sym_size = 0.1; }
1. the programme seems to hang if you just press return
2. I don't know what to put in for the if condition to test for pressing return with no other input
Is there a smart way of doing this?



LinkBack URL
About LinkBacks


