0

I need help with this please dont associate with other question.

bool is_float(string num){
/*
 * FIXME:
 */
return false;
}

for this function it says that the input(parameters) is string num. It also says that the output (return type) is bool The description says "Indicates if a given string is an float" Please help me write this function

Skezz00
  • 1
  • 1
  • You can use the std::stof() function to convert the provided string to float. If if no conversion could be performed - std::invalid_argument exception will be thrown. if the converted value would fall out of the range of the result type or if the underlying function sets errno to ERANGE then throws the std::out_of_range exception. – Ishara Madushan May 24 '22 at 05:53
  • 1
    [`std::stof`](https://en.cppreference.com/w/cpp/string/basic_string/stof) – Alan Birtles May 24 '22 at 05:53
  • 1
    How does one identify a floating point number? What are its defining features? Make a list and then write code that will allow the program to detect each of the cases in the list. – user4581301 May 24 '22 at 05:53

0 Answers0