I want to write a function to check if any inputs from user valid or invalid. The problem here is that I dont know how to check if there are more than one decimal point appears in floating-point input?
you can read the input into a string. do two searches (find and rfind). if the two search results are not equal, you have more than one dot in it. so the input is invalid.
after that work with a stringstream and convert the input to a float/double.
or u could use atof instead of the stringstream.