5.3.4.11. Function args_find_float_min

5.3.4.11.1. Function Documentation

float args_find_float_min(int argc, char **argv, const char *arg, float def, float min)

Find an argument and return its corresponding value as a floating-point value. This function also tests that the returned value is higher (or equal) than a minimum value. If it is not the case, it prints an error message and exits the program with -1 value.

Parameters
  • argc – Number of arguments in argv array of arguments.

  • argv – Array of arguments.

  • arg – Argument to look for. Note that a list of arguments can be provided: arguments have to be separated by a comma (‘,’) character.

  • def – Default value if the argument is not found.

  • min – Minimum accepted value.

Returns

Value corresponding to the argument if it exists in the command line, def value otherwise.