I am looking for a way to get floating point input from a user.
My way of going about this is to use a self-made getstrn function and plug that into another function
Any of:
Of these sscanf offers the strongest validation, since the other two return a valid double value of 0.0 if the input cannot be interpreted as a double, while sscanf() returns the number of format specifiers successfully matched to the input. So:
input_valid = (sscanf( arr, "%lf", value ) != 0 ) ;